Foren / Cotonti / Extensions / [HELP][WIP] Plugin: User Comments

GHengeveld
#18158 25. Oktober 2009, 05:58
You need to import the $ui variable from GET, otherwise your query won't work. Also it's better to cast or check any variables used in an SQL query. Integers should be cast using (int)$variable and strings need to be prepped using sed_sql_prep(). Another minor detail is that you shouldn't put quotes around an integer, since that would require it to be converted from string to integer.
Try this:

$ui = sed_import('ui', 'G', 'INT');
$sql2 = sed_sql_query("SELECT * FROM $db_com WHERE com_authorid=".(int)$ui);

For the rest of it, it's looking good, keep it up. Glad to see my guide gets used too :)

Dieser Beitrag wurde von Koradhil (am 25. Oktober 2009, 06:06, vor 15 Jahre) bearbeitet