MYSQL, PHP Problems

I am trying to connect Authorware to my mysql database. Both
are online and I want to write test answers to my database
and also read them back out and display them in my authorware
piece.
In a plain authorware page i have in a calculation:
Result := ReadURL
http://www.dundee.ac.uk/.../example/authorware2.php")
And then {Result} on the authorware page.
What returns is the source code for the php page plus
whatever is printed to the screen by that .php page. I want
what is printed to the screen as it is the contents of the
variable needed, but not the rest of the stuff. How do I
simple pass just that variable back to authorware and not all
the rest of the stuff.
I also have an issue with writing to the database using:
action := "?data="
query := ActivityAnswer1a
db_loc := "
http://www.dundee.ac.uk/..../"
URLstring := db_loc^"authorware.php"^action^query
queryString := ReadURL(URLstring)
It seems to sometimes write 2 entries and not the required
one. Not sure why.

There are some other things that must be done to connect to
the database
(such as passing the usernamee, password, and host info to
mysql_connect()
and storing the connection resource), and those might be in
the include
files. I generally place all of the connection parameters in
a separate file
that is located in a folder that can't be accessed by a
browser, for
security purposes.
Paul Swanson
Portland, Oregon, USA
"Amy Blankenship *AdobeCommunityExpert*"
<[email protected]>
wrote in message news:edk6ui$69c$[email protected]..
> What's in the include(s)?
>
> "83Dons" <[email protected]> wrote in
message
> news:edk5s5$4uk$[email protected]..
> > Here is the php code for the 'read' and 'write'
parts:
> >
> >
> >
> > <?php
> > include '......';
> > mysql_select_db('clinskills') or die("UNABLE TO
CONNECT TO
DATABASE");
> > $sql = "select A1Answer from authorware where id =
'13'";
> > $result = mysql_query($sql);
> > $answer1 = mysql_result($result,0,"A1Answer");
> > print $answer1;
> > ?>
> >
> > <?php
> > include '............';
> > mysql_select_db('clinskills') or die("UNABLE TO
CONNECT TO
DATABASE");
> > $newdata = $_GET['data'];
> > mysql_query("insert into authorware (A1Answer)
values('$newdata')")
or
> > die(mysql_error());
> > mysql_close(); ?>
> >
>
>

Similar Messages

  • PHP and MySQL Connection problem

    I am trying to make a PHP MySQL on a remote server connection in Dreamwesaver CS3.
    When I enter the information (host, user, password, etc.) and hit TEST, I get the following error message.
    "Access Denied. The file may not exist, or there could be a permission problem. Make sure you have proper authorization on the server and the server is properly configured."
    I know the user, password, etc. work, as I can access the MySQL database with other software.
    I checked with my host and they say there are no permission problems on their end.
    I have checked the settings on the Test Server page in Site Setup and everything looks correct and works there.
    I have not seen this particular problem described in other forum postings (although there are a LOT of postings on this topic!).
    Any help would be appreciated.

    I thought my testing server was the remote server and is always on as far as I know. I don't know how to turn it on or off.
    Is there some other testing server that I should be aware of?
    Frank
    Date: Wed, 3 Jun 2009 15:43:02 -0600
    From: [email protected]
    To: [email protected]
    Subject: PHP and MySQL Connection problem
    I know you are using remote, but is your testing server on? if not turn that on and see if that does it. it just happened to me working on remote server and could not get mysql conn to work, until I turn on my testing (developer server), then I was able to connect to mysql and the tables that I created in phpmyadmin remotly was downloaded.
    >

  • Update MySQL & PHP Version

    I have a Mac Mini that I am using as a server and I can't figure out how to go about updating the MySQL & PHP that is controlled by the ServerAdmin app. Any ideas?

    I ran an install of 10.4.4. The update ran with no problems.

  • DW CS4 MySQL Connection Problem

    I know this one has been covered before but i've been trawling through posts for the past 2 days and still haven't solved my problem.
    I remember from using MX Studio and Ultradev that setting up a connection could prove challenging. It seems that CS4 is just as user-unfriendly in this regard. I know that the settings i'm using for the connection must be correct as i'm using them to successfully connect to the database and display its records using a hand-coded page. I've tried disabling Kaspersky and Windows Firewall but to no avail. I noticed one difference between the php script that dw attempted to make and mine is that i'm using mysqli whereas the dw version just refers to mysql. When I click on the Select button to try and select the database i just get  "An unidentified error has occurred" - about as much use as a chocolate fireguard - well done to the dw development team for that pearl of wisdom. Is dw trying to find my databse somewhere where it's not located? I noticed that C:/InetPub and its subfolders are marked "read only" but when you uncheck this, it reverts to read only - i don't know if this may have something to do with my inability to set up a connection. I managed to manually set up MySQL, PHP and Apache without problems but this has got me beat. Is it bad design in dw or am i just stupid? Don't answer that! Any help would be greatly appreciated as i know there's a lot of good stuff in dw if i could only make a connection (and i'm on a 30 day trial with this) Why should something that looks so easy be so difficult! Thanks, Mark

    Hi PZ,
             You're correct! I just managed to get my connection to work. I looked in my php.ini file and it only had extension=php_mysqli.dll at the bottom of the page (the dll file to which this refers was in the ext folder). So, I just added extension=php_mysql.dll to the end of the php.ini file then downloaded the PHP 5.2.13 zip package from http://www.php.net/downloads.php and then copied the file php_mysql.dll into the ext folder. I got the clue about mysqli not being supported after i'd carried out a Site > Advanced > Remove Connection scripts - that at least gave me a message "Your PHP Server doesn't have the MySQL module loaded or you cant use the mysql(p) connect functions" - before i did this i just got a useless "An unidentified error has occurred" which left me no further forward. Thanks for your help!

  • Mysql, PHP, and Dreamweaver

    Hi!
    I am struggling with the mysql connection problem with
    Dreamweaver 8.02 on the mac. I downloaded the trial version of both
    the Windows and the Mac of Dreamweaver. On the Windows side, I can
    put all my information in and it connects to the database fine.
    However, if I duplicate every single entry for the server
    information on the Windows side to the Mac side, I get the never
    ending problematic "404 File Not Found" error message and
    "unidentified error" message that keeps popping up.
    Even furthermore, after checking the web server logs, when I
    test the mysql connection on the Windows end, I see a post on the
    web server. When I check it from the mac end, I see nothing on the
    web server.
    I have used Dreamweaver in the past on the mac side, and I
    have always struggled with getting this to work. Why am I having so
    many problems with it and how can I resolve them?
    Thanks in advance...

    wiz561 wrote:
    > However, if I duplicate every single entry for the
    server information on
    > the Windows side to the Mac side, I get the never ending
    problematic "404 File
    > Not Found" error message and "unidentified error"
    message that keeps popping up.
    This is probably a result of the testing server definition on
    your Mac.
    The normal location for dynamic sites on a Mac is in the
    Sites folder of
    your home folder. The URL prefix for this translates to this:
    http://localhost/~username/
    Not
    http://localhost/ as on Windows.
    David Powers
    Adobe Community Expert
    Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
    http://foundationphp.com/

  • Apache/MySQL/PHP and Mountain Lion

    I was about to buy Mountain Lion, but I just read by a reviewer that there is an issue with the webserver or websharing capabilities of it. The reviewer was saying he/she had to go into the terminal and launch it from there!
    Is anybody else having issues with developing database driven sites on Mountain Lion, or are you getting on OK with it?
    I currently use xammp as my apache/mysql/php server. Is anybody on Mountain Lion using xammp, if not, what equivalent are you using?
    Thanks.
    Mat

    Starting Apache is very easy. Simply type the following into a terminal:
    sudo apachectl start
    I think that they removed the tick box because it's so easy to do from terminal, and not something that most OSX users need.
    As SnakEyez02 mentioned, using a package like MAMP or XAMPP doesn't require this. Those apps run their own Apache

  • Inserting & uploading records with Dreamweaver CS3, MYSQL & PHP

    I'm able to build a web page that allows for images to be
    uploaded to a server folder. Also have a web page created to insert
    info about the image into a MYSQL/PHP database.
    My goal is to find a way to combine the two together so that
    when you click the submit button... 1) the image gets uploaded to
    the server folder, 2) the info about the image gets placed into the
    database table, and 3) there is an entry in the database that
    establishes the path to the image.
    Any help or direction to a tutorial would be greatly
    appreciated.

    I use a DW extension from DMXzone (Pure PHP Upload) that
    allows me to both insert data form an online form into a MySQL
    table as well as upload files to a directory on the server with one
    button click. This might be a solution for you.

  • Bootstrap + mysql + php: robust solution for an educational dashboard?

    Hi. We are just beginning work on a dashboard for educational purposes. We need to show data tables of sts progress, notes etc...
    Kind of like the following tables:
    http://www.dreambox.com/district-reports
    We have downloaded a template based on bootstrap. It is all pretty easy except for the data integration. Before we were using flash datagrids and were also looking at flex components which were very easy to use. The questions are:
    1. Can we get the same "power" for our data tables/data grids with bootstrap "ready made" plugin ins.
    2. To replicate the datadrid in flash what do we use in bootstrap - ajax datatable or a j query plug in.
    3. How do we connect up the mysql + php + datagrid. Would it be very similar to an AS3 + php + mysql solution?
    Basically, is bootstrap html5 + CSS a viable robust solution to producing an educational dashboard.
    I use the term plugin because I don't think you call them components or widgets.
    You must also know that this will be on an enterprise level and there should be around 10,000 active users - not at the same time obviously. We will be hiring a freelancer or part tim staff to implement and maintain but we do need to know which way to go first.
    Pretty broad questions maybe, just trying to find my way and study up on what I am supposed to be studying up on. I am on Lynda.com which is OK but I need some guys creating these things to give me advice and point us in the right direction.
    Cheers in advance.

    Hi - thank you Nancy - I should get really specific now.
    I spent quite a few hours investigating and here's the run down.
    1. php + mysqli: Pretty easy as it is the same workflow as I use in flash - I was just a bit thrown by the html part and still have a few questions.
    I will post the link to the very clean and easy to follow mysql + php implementation on html tables just in case any newbies are following the post.
    http://www.sourcecodetuts.com/php/18/how-create-secure-registration-page-phpmysql-part-ii
        mysqli - they seem to use the "improved" mysqli now and this code seems to be very professional with encryption etc...
    My question is which is the best method for handling the recordset back from the database.
    1. In flash we used to use XML serialized which is easy for flash objects to pick up and then display in the datagrid tables.
    2. The example in the next link echos it out in the html table format which sounds very obvious but not sure if it is correct as I have never dome that before.
    http://www.sourcecodetuts.com/php/40/creating-and-populating-table-mysql-data-using-twitte r-bootstrap-framework
    while ($row = mysql_fetch_array($result)) {
        // Print out the contents of the entry
        echo '<tr>';
        echo '<td>' . $row['firstname'] . '</td>';
        echo '<td>' . $row['lastname'] . '</td>';
        echo '<td>' . $row['email'] . '</td>';
        echo '<td>' . $row['phone'] . '</td>';
    3. However I am more used to dealing with an object returned and then dealt with in flash BUT a simple html table couldn't deal with that so - I have just started reading re: ajax or javascript. Are they the best way to handle data returned from a database. As I say this dashboard wil have to be used my many thousands and we will be creating various tables with multiple parameters inputted via dropdown box lists.
    My workflow in flash - would it be javascript that would replicate that functionality or do I just echo out in tr and td tags as in above - seems to basic.
    Sorry about repeating mysel above and going on and on but I hace finally got there - just missing the last part in the puzzle.
    Cheers

  • CANNOT FIND mmhttpdb.php  and mysql.php  files

    does anyone know where I can download these two files from ? (in order to connect to database)
    mmhttpdb.php     mysql.php
    I deleted them accidentially.

    * Vista/Windows 7: C:\Program Files (x86)\Adobe\Adobe Dreamweaver CC\Configuration\DisabledFeatures
    * Mac OS X: /Applications/Adobe Dreamweaver CC/Configuration/DisabledFeatures
    If they no longer reside anywhere including your trash/recycle bin, you may need to re-install CC.
    Nancy O.

  • Communication problem MYSQL PHP XML Flash.

    I have driven myself into a corner with this so I hope someone here knows a solution.
    I am building a photogallery with a simple html layout but with a flash slideshow.
    The data for each album and photo are stored in a mysql database. Each photo-image is in one big folder on the server. With PHP I sort out which photo belongs to what album and display them accordingly. To start the slideshow people can click on a link near the album, this link will send a < href> with the album ID to an PHP file (xml.php) that will generated an XML output created from the MYSQL server. Here comes my problem:
    Loading XML into flash is no problem BUT I only know how to do this with a static or self supporting XML output. (xml.php needs the input of the album ID else it will not get the correct data). For now I have a temporary solution where I write the XML output from xml.php to a txt file and let Flash read from there, but is there a way where I can read directly from xml.php?

    Echo your formatted xml out as a string in xml.php, Flash will then read your dynamically generated XML.

  • Mediawiki, mysql, php? problems [SOLVED]

    On Sunday my Arch install that is hosted by Slicehost became unresponsive to them so they had to do an emergency reboot. After it came back up my install of mediawiki was (and still is) only returning a blank page (at least in Firefox). After some digging I found out that part of the problem was that mysqld wasn't starting so I managed to get that fixed by commenting out the lines relating to innodb and putting in skip-innodb into my.cnf. But I'm still getting a blank page.
    According to Mediawiki's manual, "A blank white page indicates a PHP error which isn't being printed to the screen." They give two lines to put into LocalSettings.php to force error messages but after doing that I'm still getting a blank page. Changing display_errors in php.ini to ON didn't have any effect.  When I load the wiki in Safari I get the following error: "Got java.io.EOFException (Server closed connection while sending the HTTP header.): http://some_url.com/mediawiki/index.php/Main_Page". I have no idea what this error means and googling java.io.EOFException doesn't bring up anything very helpful. My PHP Test Page indicates that PHP is up and running.
    Any ideas on fixes or where I can find more clues?
    [EDIT]
    Mysql was definitely the root of the problems with Mediawiki. I tried nearly every suggestion listed in the forums for fixing a mysql install that wouldn't start but nothing worked. I even completely uninstalled mysql and reinstalled it but it still refused to start. I switched over to postgresql and switched mediawiki to run with that. Problem solved.
    Last edited by k_odoma (2009-05-23 01:48:35)

    There are some other things that must be done to connect to
    the database
    (such as passing the usernamee, password, and host info to
    mysql_connect()
    and storing the connection resource), and those might be in
    the include
    files. I generally place all of the connection parameters in
    a separate file
    that is located in a folder that can't be accessed by a
    browser, for
    security purposes.
    Paul Swanson
    Portland, Oregon, USA
    "Amy Blankenship *AdobeCommunityExpert*"
    <[email protected]>
    wrote in message news:edk6ui$69c$[email protected]..
    > What's in the include(s)?
    >
    > "83Dons" <[email protected]> wrote in
    message
    > news:edk5s5$4uk$[email protected]..
    > > Here is the php code for the 'read' and 'write'
    parts:
    > >
    > >
    > >
    > > <?php
    > > include '......';
    > > mysql_select_db('clinskills') or die("UNABLE TO
    CONNECT TO
    DATABASE");
    > > $sql = "select A1Answer from authorware where id =
    '13'";
    > > $result = mysql_query($sql);
    > > $answer1 = mysql_result($result,0,"A1Answer");
    > > print $answer1;
    > > ?>
    > >
    > > <?php
    > > include '............';
    > > mysql_select_db('clinskills') or die("UNABLE TO
    CONNECT TO
    DATABASE");
    > > $newdata = $_GET['data'];
    > > mysql_query("insert into authorware (A1Answer)
    values('$newdata')")
    or
    > > die(mysql_error());
    > > mysql_close(); ?>
    > >
    >
    >

  • Recordset problem mysql / php

    Hi
    Having a problem that I can't find a way out of. I am trying
    to create a recordset on a php / mysql setup not on my local
    machine though. I am getting an error of 500 internal server error
    when testing the connection. In the recordset builder I can see the
    db and the tables ok but when I click test I get the error. It is
    happening every time. Any ideas?

    www.DwFAQ.info wrote:
    Well when I first saw your screenshot of Recordset window I was wondering what parameter you were filtering about_id against. First now all I see is the characters *** in the drop-down option. You should pick something like URL parameter, Session Variable, Entered Value, etc. something to filter about_id against, ya know?
    That was the problem it wouldnt display session variable or or any of the other options it would only display *** no matter what I was trying to filter against....  Wasnt a huge deal since i could just hand code it but the wizard is faster
    I nuked the configuration folder and that seemed to have taken care of the problem..

  • MySQL PHP question/problem.....blank page!

    This is new to me, so be gentle and let me know what might be
    happening
    here.
    - I set up a MySQL database which seems fine
    - Set up a testing server for the site (the root of the
    remote site) which
    tests okay
    - Set up a Connection which tests okay
    - Created a Recordset which tests okay
    - Inserted a REPEAT REGION and even just a field to
    display.....I get a
    blank page. Blank with DESIGN VIEW and blank with f12 and
    blank if I upload
    it and look at the page.
    How can everything check out and test out yet it's not
    returning anything? I
    know there's an easy answer here....
    If it helps, here's the code:
    <?php require_once('Connections/jobs.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType,
    $theDefinedValue = "",
    $theNotDefinedValue = "")
    $theValue = get_magic_quotes_gpc() ? stripslashes($theValue)
    : $theValue;
    $theValue = function_exists("mysql_real_escape_string") ?
    mysql_real_escape_string($theValue) :
    mysql_escape_string($theValue);
    switch ($theType) {
    case "text":
    $theValue = ($theValue != "") ? "'" . $theValue . "'" :
    "NULL";
    break;
    case "long":
    case "int":
    $theValue = ($theValue != "") ? intval($theValue) : "NULL";
    break;
    case "double":
    $theValue = ($theValue != "") ? "'" . doubleval($theValue) .
    "NULL";
    break;
    case "date":
    $theValue = ($theValue != "") ? "'" . $theValue . "'" :
    "NULL";
    break;
    case "defined":
    $theValue = ($theValue != "") ? $theDefinedValue :
    $theNotDefinedValue;
    break;
    return $theValue;
    $maxRows_Jobs1 = 6;
    $pageNum_Jobs1 = 0;
    if (isset($_GET['pageNum_Jobs1'])) {
    $pageNum_Jobs1 = $_GET['pageNum_Jobs1'];
    $startRow_Jobs1 = $pageNum_Jobs1 * $maxRows_Jobs1;
    mysql_select_db($database_jobs, $jobs);
    $query_Jobs1 = "SELECT job_title, salary FROM jobs ORDER BY
    job_title ASC";
    $query_limit_Jobs1 = sprintf("%s LIMIT %d, %d", $query_Jobs1,
    $startRow_Jobs1, $maxRows_Jobs1);
    $Jobs1 = mysql_query($query_limit_Jobs1, $jobs) or
    die(mysql_error());
    $row_Jobs1 = mysql_fetch_assoc($Jobs1);
    if (isset($_GET['totalRows_Jobs1'])) {
    $totalRows_Jobs1 = $_GET['totalRows_Jobs1'];
    } else {
    $all_Jobs1 = mysql_query($query_Jobs1);
    $totalRows_Jobs1 = mysql_num_rows($all_Jobs1);
    $totalPages_Jobs1 = ceil($totalRows_Jobs1/$maxRows_Jobs1)-1;
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN"
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="
    http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1" />
    <title>Database test</title>
    </head>
    <body>
    <table width="100%" border="0" cellspacing="0"
    cellpadding="0">
    <tr>
    <?php do { ?>
    <td> </td>
    <?php } while ($row_Jobs1 = mysql_fetch_assoc($Jobs1));
    ?>
    </tr>
    <tr>
    <td> </td>
    </tr>
    <tr>
    <td><?php echo $row_Jobs1['job_title'];
    ?></td>
    </tr>
    </table>
    </body>
    </html>
    <?php
    mysql_free_result($Jobs1);
    ?>
    THANKS,
    Mad Dog
    (be gentle)

    no worries mad, glad you got it fixed man.
    "Mad Dog" <[email protected]> wrote in message
    news:ecqpkh$ocp$[email protected]..
    >I added that, though it wasn't the problem. And I don't
    know why DW didn't
    >add it.
    >
    > But I've got things working now. By INSERTING a DYNAMIC
    TABLE and
    > modifying the code I'm getting what I wanted. It was
    something about doing
    > it with a table and REPEAT REGION that got things (me?)
    bolluxed up.
    >
    > Thanks for the help!
    > MD
    >
    >
    >
    > crash wrote:
    >> switch ($theType) {
    >> case "text":
    >> $theValue = ($theValue != "") ? "'" . $theValue .
    "'" : "NULL";
    >> break;
    >> case "long":
    >>
    >> you should insert the following text:
    >> break; after this (Idon't know why DW didn't do it)
    >>
    >>
    >> case "int":
    >> $theValue = ($theValue != "") ? intval($theValue) :
    "NULL";
    >> break;
    >>
    >>
    >> Also,it currently looks like your do while is
    surrounding an empty
    >> table cell.
    >
    >

  • Php mySQL filtering problem...really desperate

    Hi
    I have a live site that is currently causing me some issues
    It is a fashion site that sends the product information that is pulled in from sevaral table to the checkout.. the issue i am having is the incorrect stock id is being sent to the checkout so when it returns from the gateway it is updating the wrong stock levels.
    What is happening currently is the stockID from the first size is being sent.
    what i have is the following tables
    table 1 - beauSS13_products
    ProductID
    CatID
    table 2 - beauSS13_Cat
    catID
    table3 - beauSS13_Stock
    StockID
    ID (this was named like this incorrectly) but this joins with ProductID
    SizeID
    Stock
    beauSS13_SizeList
    SizeID
    Size
    the SQL is
    $var1_rsProduct = "-1";
    if (isset($_GET['ProductID'])) {
      $var1_rsProduct = $_GET['ProductID'];
    mysql_select_db($database_beau, $beau);
    $query_rsProduct = sprintf("SELECT * FROM beauSS13_Cat, beauSS13_products, beauSS13_Stock, beauSS13_SizeList WHERE beauSS13_products.CatID = beauSS13_Cat.catID AND beauSS13_products.ProductID = beauSS13_Stock.ID AND beauSS13_Stock.SizeID = beauSS13_SizeList.SizeID AND beauSS13_products.ProductID = %s AND beauSS13_Stock.Stock != 0 ", GetSQLValueString($var1_rsProduct, "int"));
    i think beauSS13_products.ProductID = beauSS13_Stock.ID shouldnt be there ( but am not sure what it should have )
    I need to identify the Unique Stock ID from table3 - beauSS13_Stock
    basically cant get my head round the logic...
    if i remove beauSS13_products.ProductID = beauSS13_Stock.ID
    then in the
    select list
    <select name="SelectSize" id="SelectSize">
            <option value="Select Size">Select Size</option>
            <?php
    do { 
    ?>
            <option value="<?php echo $row_rsProduct['Size']?>"><?php echo $row_rsProduct['Size']?></option>
            <?php
    } while ($row_rsProduct = mysql_fetch_assoc($rsProduct));
      $rows = mysql_num_rows($rsProduct);
      if($rows > 0) {
          mysql_data_seek($rsProduct, 0);
                $row_rsProduct = mysql_fetch_assoc($rsProduct);
    ?>
          </select>
    it outputs all sizes from the ProductID and not just from the selected item
    i have just tried
          <select name="SelectSize" id="SelectSize">
            <option value="Select Size">Select Size</option>
            <?php
    do { 
    ?>
            <option value="<?php echo $row_rsProduct['Size']?>"><?php echo $row_rsProduct['Size']?><?php echo $row_rsProduct['StockID']; ?></option>
            <?php
    } while ($row_rsProduct = mysql_fetch_assoc($rsProduct));
      $rows = mysql_num_rows($rsProduct);
      if($rows > 0) {
          mysql_data_seek($rsProduct, 0);
                $row_rsProduct = mysql_fetch_assoc($rsProduct);
    ?>
          </select>
    and adding <?php echo $row_rsProduct['StockID']; ?>
    i can see the correct StockID is showing in the size menu but i just need to get that to send to cart
    this is the code that sends the details to the cart
    $XC_editAction1 = $_SERVER["PHP_SELF"];
    if (isset($_SERVER["QUERY_STRING"])) $XC_editAction1 = $XC_editAction1 . "?" . $_SERVER["QUERY_STRING"];
    if (isset($_POST["XC_addToCart"]) && $_POST["XC_addToCart"] == "form1") {
      $NewRS=mysql_query($query_rsProduct, $beau) or die(mysql_error());
      $XC_rsName="rsProduct"; // identification
      $XC_uniqueCol="ProductID";
      $XC_redirectTo = "";
      $XC_redirectPage = "../cart.php";
      $XC_BindingTypes=array("RS","RS","FORM","FORM","RS","RS","RS","NONE");
      $XC_BindingValues=array("StockID","ProductID","SelectSize","Quantity","Product","Price"," Stock","");
      $XC_BindingLimits=array("","","","","","","","");
      $XC_BindingSources=array("","","","","","","","");
      $XC_BindingOpers=array("","","","","","","","");
      require_once('XCInc/AddToXCartViaForm.inc');

    >>Why do you think that?
    because it was looking for the specific record, but having added <?php echo $row_rsProduct['StockID']; ?> to the select list it needs to be there
    >>You are joining 4 tables so you need 3 join conditions. If that's the correct relationship ( and only you will know that) then the SQL is correct.
    yes that is the way the joins are meant to be
    >>The problem is most likely how you are assigning values to the cart. When the user selects a color, how is the associated stock id bound to the array?
    its sizes they select but same thing, in the above code that the thing i need to pass that value to the cart. the way i have it at the moment is in the code above
    i have icluded the full code below to show you how its working
    // *** X Shopping Cart ***
    $useSessions = false;
    $XCName = "beauloves";
    $XCTimeout = 1;
    $XC_ColNames=array("StockID","ProductID","Size","Quantity","Name","Price","Stock","Total") ;
    $XC_ComputedCols=array("","","","","","","","Price");
    require_once('XCInc/XCart.inc');
    $var1_rsProduct = "-1";
    if (isset($_GET['ProductID'])) {
      $var1_rsProduct = $_GET['ProductID'];
    mysql_select_db($database_beau, $beau);
    $query_rsProduct = sprintf("SELECT * FROM beauSS13_Cat, beauSS13_products, beauSS13_Stock, beauSS13_SizeList WHERE beauSS13_products.CatID = beauSS13_Cat.catID AND beauSS13_products.ProductID = beauSS13_Stock.ID AND beauSS13_Stock.SizeID = beauSS13_SizeList.SizeID AND beauSS13_products.ProductID = %s AND beauSS13_Stock.Stock != 0 ", GetSQLValueString($var1_rsProduct, "int"));
    $rsProduct = mysql_query($query_rsProduct, $beau) or die(mysql_error());
    $row_rsProduct = mysql_fetch_assoc($rsProduct);
    $totalRows_rsProduct = mysql_num_rows($rsProduct);
    mysql_select_db($database_beau, $beau);
    $query_rsCategory = sprintf("SELECT * FROM beauSS13_products WHERE
    beauSS13_products.CatID = (SELECT CatID from beauSS13_products WHERE beauSS13_products.ProductID = %s)", GetSQLValueString($var1_rsProduct, "int"));
    $rsCategory = mysql_query($query_rsCategory, $beau) or die(mysql_error());
    $row_rsCategory = mysql_fetch_assoc($rsCategory);
    $totalRows_rsCategory = mysql_num_rows($rsCategory);
    //  *** Add item to Shopping Cart via form ***
    $XC_editAction1 = $_SERVER["PHP_SELF"];
    if (isset($_SERVER["QUERY_STRING"])) $XC_editAction1 = $XC_editAction1 . "?" . $_SERVER["QUERY_STRING"];
    if (isset($_POST["XC_addToCart"]) && $_POST["XC_addToCart"] == "form1") {
      $NewRS=mysql_query($query_rsProduct, $beau) or die(mysql_error());
      $XC_rsName="rsProduct"; // identification
      $XC_uniqueCol="ProductID";
      $XC_redirectTo = "";
      $XC_redirectPage = "../cart.php";
      $XC_BindingTypes=array("RS","RS","FORM","FORM","RS","RS","RS","NONE");
      $XC_BindingValues=array("StockID","ProductID","SelectSize","Quantity","Product","Price"," Stock","");
      $XC_BindingLimits=array("","","","","","","","");
      $XC_BindingSources=array("","","","","","","","");
      $XC_BindingOpers=array("","","","","","","","");
      require_once('XCInc/AddToXCartViaForm.inc');
    function DoFormatCurrency($num,$dec,$sdec,$sgrp,$sym,$cnt) {
      setlocale(LC_MONETARY, $cnt);
      if ($sdec == "C") {
        $locale_info = localeconv();
        $sdec = $locale_info["mon_decimal_point"];
        $sgrp = $sgrp!="" ? $locale_info["mon_thousands_sep"] : "";
        $sym = $cnt!="" ? $locale_info["currency_symbol"] : $sym;
      $thenum = $sym.number_format($num,$dec,$sdec,$sgrp);
      return $thenum;
    then below is the form that sends the information to the cart
    <form id="form1" name="form1" method="post" action="<?php echo $XC_editAction1; ?>">
    <select name="SelectSize" id="SelectSize">
            <option value="Select Size">Select Size</option>
            <?php
    do { 
    ?>
            <option value="<?php echo $row_rsProduct['Size']?>"><?php echo $row_rsProduct['Size']?></option>
            <?php
    } while ($row_rsProduct = mysql_fetch_assoc($rsProduct));
      $rows = mysql_num_rows($rsProduct);
      if($rows > 0) {
          mysql_data_seek($rsProduct, 0);
                $row_rsProduct = mysql_fetch_assoc($rsProduct);
    ?>
          </select>
          <select name="Quantity">
            <option value="Select Quantity">Select Quantity</option>
            <option value="1">1</option>
            <option value="2">2</option>
            <option value="3">3</option>
            <option value="4">4</option>
            <option value="5">5</option>
          </select>
    <input type="image" src="../images/SS13AddToCart.jpg" border="0" name="submit"/>
    <input type="hidden" name="XC_recordId" value="<?php echo $row_rsProduct['ProductID']; ?>" />
          <input type="hidden" name="XC_addToCart" value="form1" />
          </form>

  • Dreamweaver PHP/mySQL poll problem?

    Hi,
    I'm a PHP/mySQL noob who's using some of Dreamweaver's 8
    (8.2) out-of-box Update server behaviors to update a database of
    results for a poll. I know there's a lot of free polling apps out
    there but I need to have the poll show up in another page as
    opposed to being refreshed/displayed in the same page/content area.
    I've successfully built the backend in phpMyAdmin and I'm
    able to list the database contents and do basic updates to the poll
    questions and answers. However, I've been unable to pass an
    incremented result value via a Dreamweaver radio button group
    (which is the normal poll format) without previous unselected
    results being overwritten.
    When an answer is selected the result is indeed incremented
    and is displayed in the Result Listing but unfortunately it also
    overwrites any preexisting data for that poll and replaces it with
    zero. For example:
    Question:
    Answer a) 0
    Answer b) 0
    Answer c) 1 (this would be the value that was selected)
    Answer d) 0
    If c is selected again the value is stored and incremented
    and the value is now 2. However, if that value is not selected,
    then another value is incremented and c would be wiped. I've even
    resorted to trying to use javascript to maintain the original state
    but to no avail I was just previously incrementing the inline php
    radio button value and/or assigning different names to each of the
    radio buttons. This, of course, allows people to select multiple
    values which runs contrary to the whole idea behind radio buttons,
    but I thought I'd see if that worked . Anyway, when the radio group
    is assigned the same value it merely increments everything.
    example:
    http://www.dailydatum.com/funFacts/funFactsListingSingleUpdate15.php
    As you can see, i'm up to version 15 and gritting me teeth,
    lol. Any help would be mighty appreciated.
    Mario

    hi ,
    you can always try the macromedia devnet sites , they have
    ongoing tutorials and discussions on all areas, including php with
    dreamweaver8.
    http://www.adobe.com/devnet/topics/php.html
    be aware though that some of the tutorials require the use of
    third party php extensions, like interakt products, which is a
    shame because most of them are expensive to buy. But they are still
    worth a read.
    hope this is some help.
    ted.

Maybe you are looking for