Jump to content

cannot find the source of the error.


boo_lolly

Recommended Posts

[code]i get this error:
Parse error: parse error, expecting `';'' in /../../../../addCouple.php on line 156


[code=php:0]
    @ $db = mysql_connect("yah", "blah", "blah");
    mysql_select_db("registry_DB", $db);

    if(!$db)
    {
        echo "Error: Could not connect to the database. Please try again later.";
        exit;
    }

    $sql = "SELECT uID FROM my_search_table WHERE uID LIKE '%". $uID ."%'";
    $query = mysql_query($sql);

    do
    {
        include "rand_gen.inc";
        $sql_array = mysql_fetch_array($query);
    }
    while($uID === $sql_array['uID']) //if there WAS a match in the database
    {    //<--  LINE 156.... weird i know...
        include "rand_gen.inc";
    }

    $uID          = $_POST['uID'];
    $brideFname  = $_POST['brideFname'];
    $brideLname  = $_POST['brideLname'];
    $gooomFname  = $_POST['groomFname'];
    $groomLname  = $_POST['groomLname'];
    $event_day    = $_POST['event_day'];
    $event_month  = $_POST['event_month'];
    $event_year  = $_POST['event_year'];
    $ship_add    = $_POST['ship_add'];
    $ship_city    = $_POST['ship_city'];
    $ship_zip    = $_POST['ship_zip'];
    $ship_state  = $_POST['ship_state'];

    //insert row of data into 'my_search_table'
    //create table named the unique ID AND a few
    //preset columnfield names (registry info)
[/code]

a little background... basically this is an administrative page, where the admin can enter information inside an HTML form, then when the admin clicks the 'Submit' button, it stores all the information into a SQL table, THEN creates another SQL table, and names it the unique ID (uID).

rand_gen.inc is exactly that. it's a random ID generator. as you may be able to tell from my code, after the unique ID is generated it checks the uID column in 'my_search_table' to see if it's already there. if it is, run the ID generator again and again until it doesn't match anything in that column. once it generates a completely unique ID, it inserts all the information entered by the admin into a row in 'my_search_table'. my question is, is it necessary to put 'uID' inside $sql_array['?']... since i'm only selecting one column... is that right? or should i put $uID in there for some reason? am i doing this correctly? HELP ME!!!
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.