Jump to content

Recommended Posts

$info = "<a href='/player/view.php?id=$mem[id]'>$mem[username]</a> bought $amounttt of <a href='index.php?code=$row[code]&sort=$userid[sort]'>$item[name]'s</a> from you for $costtt gold.";

 

This line echoes out a syntax error?

 

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?id=1'>Lord of the Abyss bought 4,200 of <a href='index.php?code=wweed&sort=' at line 2[/code]

Link to comment
https://forums.phpfreaks.com/topic/63378-solved-syntax-error/
Share on other sites

$info = "<a href='/player/view.php?id={$mem['id']}'>{$mem['username']}</a> bought $amounttt of <a href='index.php?code={$row['code']}&sort={$userid['sort']}'>{$item['name']}'s</a> from you for $costtt gold.";
$news = mysql_query("INSERT INTO news (`userid`, `info`, `timestamp`) 
	VALUES('{$userid['id']}', '$info', '$timestamp')") or die(mysql_error());

Link to comment
https://forums.phpfreaks.com/topic/63378-solved-syntax-error/#findComment-315917
Share on other sites

Just as a general rule of thumb you should always filter your input... make sure that the users have followed your rules, right datatypes, lengths, formats etc and then escape it before committing the record to the database.

 

Always always always! This will help maintain site security and data integrity.

 

And on that note I just got my phone call so I'm out of here for the night guys. Goodluck!

Link to comment
https://forums.phpfreaks.com/topic/63378-solved-syntax-error/#findComment-315924
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.