Jump to content

[SOLVED] Syntax Error


almightyegg

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.