Results 1 to 3 of 3

Thread: Parse error: syntax error, unexpected T_STRING, expecting ',' or ';'

Hybrid View

  1. #1
    Join Date
    Jan 2014

    Parse error: syntax error, unexpected T_STRING, expecting ',' or ';'

    PHP Code:
    $username "1104107";
    $password "r940c1";
    $database "db1104107";
    //echo '24';

    //connection to the database
    $dbhandle mysql_connect($hostname$username$password);
    $db mysql_select_db($database$dbhandle)
      or die(
    "Unable to connect to MySQL");
    //echo "Connected to MySQL<br>";

                                                               ArtistName VARCHAR(20), NAME of the DVD VARCHAR(30)"

    $result_createtemptable mysql_query($query_createTemporaryTable ,$dbhandle );
    $query_insertintotable "INSERT INTO everything (ArtistName, NAME of the DVD) VALUES ('RIHANNA', 'SHAWSHANK')";

    $result_insertintotable mysql_query($query_insertintotable ,$dbhandle);

    $query_selecttemptable "SELECT ArtistName,NAME of the DVD FROM temp";

    $result_selecttemptable mysql_query$query_selecttemptable,$dbhandle);

    $row_selecttemptable mysql_fetch_array($result_selecttemptable$dbhandle);

    $row_selecttemptable mysql_fetch_array($result_selecttemptable$dbhandle)){
    or die mysql_error("Try Again");

    Error:Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /studhome/0/1104107/public_html/mysql_connect.php on line 33

    I am seriously stuck. I dont know what I am missing.

    Thanks for any help provided.

  2. #2
    Join Date
    Aug 2004
    die() is a function, so requires parentheses around its arguments -- though I don't understand the logic of having an "or die()" at that point in the code, since you'll only hit it if the call to mysql_fetch_array() works. For that matter, all the echo will output is the word 'Array' if it gets anything.
    "Well done....Consciousness to sarcasm in five seconds!" ~ Terry Pratchett, Night Watch

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

    My Blog
    cwrBlog: simple, no-database PHP blogging framework

  3. #3
    Join Date
    Jan 2014
    Oh, Thanks. It works now and it adds the data to the table. I am really confused about something. Can you tell me if we can create a temporary table by using PHP. Because, I tried to create a TEMP table with php, but i just got the message " temp table not found". Hence, I had to go into phpMyAdmin and create one. If we can create a temp table using PHP. please help.

    Thank you

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center

Recent Articles