The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
SQL PHP Help needed "urgent"
i have this statement in a php file but keeps throwing up some error can someon eplease look over this code and get back to me with any morrections needed
Code:
$sql = "INSERT INTO `list` SET "; $sql .= "`stamp`='" . sql_escape_string($stamp) . "', "; $sql .= "`ip`='" . sql_escape_string($ip) . "', "; $sql .= "`type`='" . sql_escape_string($type) . "', "; $sql .= "`threat`='" . sql_escape_string($threat) . "', "; $sql .= "`datetime`=now() "; $r = sql_command($sql); if ($r == 1) { ######################################## # good insertion, get record id number # ######################################## $id = sql_insert_id("list", "id"); return $id; } function sql_command ($sql) { if (mysql_query($sql)) return mysql_affected_rows(); return -1; } function sql_insert_id($table, $field) { return mysql_insert_id(); } function sql_escape_string ($string) { if (get_magic_quotes_gpc()) { $string = stripslashes($string); } $string = mysql_real_escape_string($string); return $string; } thank you |
#2
|
|||
|
|||
It would help a lot of you would opst the error message and the linenumber on which it occurs.
|
#3
|
|||
|
|||
this is the full code i used in the php plugin
PHP Code:
the error i get is Parse error: syntax error, unexpected ')' in /public_html/includes/functions.php(6505) : eval()'d code on line 73 plugin is set to global_complete |
#4
|
||||
|
||||
This line doesn't look correct:
PHP Code:
|
#5
|
|||
|
|||
Quote:
i have now corrected the php plugin code to this PHP Code:
the error i now get is Fatal error: Call to undefined function sql_escape_string() in /public_html/includes/functions.php(6505) : eval()'d code on line 68 i think it refere to this ######################################## # good insertion, get record id number # ######################################## $id = sql_insert_id("list", "id"); return $id; } not sure how to corect it |
#6
|
||||
|
||||
I know there is a mysql call mysql_insert_id, but I don't know anything about just sql_insert_id. It doesn't take any parameters, I don't believe. It just returns the last increment used. Why aren't you just using standard vB mysql syntax?
|
#7
|
|||
|
|||
because i am unsure how to do that
the sql code is an upade scrpt, logs ip address from projecthoneypot if your listed thats what i am try to do i have no idea how to convert php sql to vb syntax can you help |
#8
|
||||
|
||||
Well, it was just more of a question, I didn't realize you didn't write the code. I think I would just try changing the line to mysql_insert_id() and see if that works. Looking at the function, it isn't clear why he passes those parameters in the first place.
Are you allowed to reuse this code? |
#9
|
|||
|
|||
yep
i am in contact withe the guy who created the code i just request help to change it to sql --------------- Added [DATE]1264449484[/DATE] at [TIME]1264449484[/TIME] --------------- thank you for that a new issue has shown PHP Code:
Parse error: syntax error, unexpected T_RETURN in /public_html/includes/functions.php(6505) : eval()'d code on line 78 |
#10
|
||||
|
||||
You need a ; at the end of the line.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|