Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 03-17-2005, 01:29 AM PHP MySQL Error
Average Talker

Posts: 24
Trades: 0
PHP Code:
<?
$handle 
fopen("/home/noveisne/public_html/scripts/marcus.php""r");
$db mysql_connect("localhost""noveisne_***","h***");
mysql_select_db("noveisne_smf1",$db);
$sql "INSERT INTO "smf_messages" ("ID_MSG", "ID_TOPIC", "ID_BOARD", "posterTime", "ID_MEMBER", "subject", "posterName", "posterEmail", "posterIP", "smileysEnabled", "modifiedTime", "modifiedName", "body", "icon") VALUES ('''', ''2'', ''2'', ''0'', ''2'', ''Test'', ''test'', ''test'', ''127.0.0.1'', ''1'', ''0'', NULL, ''tesz'', ''xx'')";

  
$result mysql_query($sql);
  echo 
"Story Added!\n";
?>
I'm confused why does that give me
Code:
Parse error: parse error, unexpected T_STRING in /home/noveisne/public_html/cron.php on line 5
marcus1060 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-17-2005, 04:16 AM
Super Talker

Posts: 110
Trades: 1
It's your use of double quotes!

You are setting the $sql variable by using double quotes, and yet inside that variable you are using double quotes. This is breaking the $sql var

And check the string near the end. You have double quotes " at the beginning but at the end of the line you are using two single quotes to make it look like a double quote '+' is showing as '' (run the cursors through each mark and you'll see what I mean).
Frank Rizzo is offline
Reply With Quote
View Public Profile Visit Frank Rizzo's homepage!
 
Reply     « Reply to PHP MySQL Error
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.36734 seconds with 12 queries