First off let me start off by saying nice hack.
I am having a big probelm with newthread.php when trying to post a newthread i hit submit it goes to the redirect splash page but then goes to this error :
Database error in vBulletin 2.2.6:
Invalid SQL: select uid, newthread from storepoint where uid=
mysql error: You have an error in your SQL syntax near '' at line 1
mysql error number: 1064
Date: Thursday 12th of September 2002 01:08:46 AM
Script: newthread.php
So I look up the query in newthread.php which is:
PHP Code:
$result=$DB_site->query("select uid, newthread from storepoint where uid=$postuserid");
i don't see anything wrong.
so I go back to my forums and see that the newthread did show up in the forums, but it has no message.
Karma didn't go up ...I reply to the message I just posted and it works fine but still karma don't go up and it is set to the admin cp.
the whole code string from around the query I posted is :
PHP Code:
//Karma
$result_new=$DB_site->query("select postuserid from thread WHERE threadid='$threadid'");
$numrows_new = mysql_num_rows($result_new);
if ($numrows_new > 0)
{
list ($postuserid) = mysql_fetch_row($result_new);
}
$result_newthread=$DB_site->query("select newthread from point");
$numrows_newthread = mysql_num_rows($result_newthread);
if ($numrows_newthread > 0)
{
list ($point) = mysql_fetch_row($result_newthread);
}
$result=$DB_site->query("select uid, newthread from storepoint where uid=$postuserid");
list ($uid, $newthread) = mysql_fetch_row($result);
$newpoints = $newthread + $point;
if ($uid == $postuserid)
{
$DB_site->query("UPDATE storepoint SET newthread=$newpoints where uid=$postuserid");
}
else
{
$DB_site->query("INSERT INTO storepoint (uid, newthread) VALUES ($postuserid, $newpoints)");
}
does anyone know what is going on how to fix this ?
Thanks