View Single Post
  #161  
Old 14th September 2009, 17:20
tekmobile tekmobile is offline
Senior Member
 
Join Date: Jul 2009
United Kingdom
Posts: 16
Default
I get a SQL error when users try to fill requests and offers any ideas what the problem may be nothing has been changed in this part of the code.


Code:
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 '(0, 0, 'Request xxxxxxx was just uploaded', 1164, '2009-09-13 01:08:43', 'The Re' at line 1
in /home/xxxxxxxx/public_html/viewrequests.php, line 611

MySQL Version (Installed on Ubuntu 8.04 Server)

mysql-server-5.0 5.0.51a-3ubuntu5.4

php5-mysql 5.2.4-2ubuntu5.7

PHP Code:
//===notify people who voted on request thanks CoLdFuSiOn :)
$res mysql_query("SELECT `userid` FROM `addedrequests` WHERE `requestid` = $requestid AND userid != $arr[userid]") or sqlerr(__FILE____LINE__);
$pn_msg "The Request you voted for [b]" $arr[request] . "[/b] has been filled by [b]" $arr2[username] . "[/b]. You can download your request from [b][URL]" $filledurl"[/URL][/b].  Please do not forget to leave thanks where due.";
$some_variable '';
while(
$row mysql_fetch_assoc($res)) {
//=== use this if you DO have subject in your PMs 
$some_variable .= "(0, 0, 'Request " $arr[request] . " was just uploaded', $row[userid], '" get_date_time() . "', " sqlesc($pn_msg) . ")";
//=== use this if you DO NOT have subject in your PMs 
//$some_variable .= "(0, 0, $row[userid], '" . get_date_time() . "', " . sqlesc($pn_msg) . ")";
}
//=== use this if you DO have subject in your PMs 
mysql_query("INSERT INTO messages (poster, sender, subject, receiver, added, msg) VALUES ".$some_variable."") or sqlerr(__FILE____LINE__);
//=== use this if you do NOT have subject in your PMs
//mysql_query("INSERT INTO messages (poster, sender, receiver, added, msg) VALUES ".$some_variable."") or sqlerr(__FILE__, __LINE__);
//===end 
Reply With Quote