Jump to content
php.lv forumi

Kas šajā kodā nepareizs


Creat1ve

Recommended Posts

Manam torrentam lec errors

 

SQL Error

Unknown column 'ip' in 'where clause'

 

in C:\Program Files\xampp\htdocs\include\bittorrent.php, line 256

 

 

 

Šeit it tā 256 līnija

$res = mysql_query("SELECT * FROM bans WHERE ip = $nip") or sqlerr(__FILE__, __LINE__);

Edited by Creat1ve
Link to comment
Share on other sites

to rindiņu aizstāj ar šito rindiņu

 

$res = mysql_query("SELECT * FROM bans WHERE ip = '$nip'") or sqlerr(__FILE__, __LINE__);

Link to comment
Share on other sites

to rindiņu aizstāj ar šito rindiņu

 

$res = mysql_query("SELECT * FROM bans WHERE ip = '$nip'") or sqlerr(__FILE__, __LINE__);

 

tas neatrisina problēmu, ka tabulā nav kolonnas.

 

un pareizi būtu

 

$res = mysql_query("SELECT * FROM bans WHERE ip = '".$nip."' ") or ...

Edited by n0r3k
Link to comment
Share on other sites

×
×
  • Create New...