-=HELLBENDER=- Posted June 28, 2011 Report Share Posted June 28, 2011 (edited) Sveiki.. Cenšos izveidot tādu kā bana skriptu. Vienā teiblā stāv informācija par lietotāju/iesūtīto informāciju un otrā banotās ip adreses. Vienā lapā vajag iegūt gan visu informāciju no pirmā teibla, gan otrā. Mēģināju ar šādu metodi; $num = $_GET["id"]; $num = strval($num); $result = mysql_query("SELECT * FROM saraksts WHERE id = $num "); $row = mysql_fetch_array($result) or die(mysql_error()); $ip=$row["ip"]; $result2 = mysql_query("SELECT * FROM ipban WHERE ip = $ip "); $row2 = mysql_fetch_array($result2) or die(mysql_error()); Priekš pirmā teibla varētu izmantot row un otrā row2, bet nē, php kaut kas nepatīk. Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in ... on line 233You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.38.219' at line 1 233: $row2 = mysql_fetch_array($result2) or die(mysql_error()); Ir kādas alternatīvas? edit: nedaudz pa-debugoju un noskaidroju ka vaina ir otrajā query, kur ir "..ip = $ip..". Izmainot uz $result2 = mysql_query("SELECT * FROM ipban WHERE ip = 123.123.123.123 "); errors pazūd, bet tas nekam neder. edit2: Viss skaidrs.. Kā jau man ierasts, aizmirsu $ip ielikt pēdiņās. Var slēgt. Edited June 29, 2011 by -=HELLBENDER=- Link to comment Share on other sites More sharing options...
rATRIJS Posted June 29, 2011 Report Share Posted June 29, 2011 Prieks pa to ka pat saprati kur problēma. Link to comment Share on other sites More sharing options...
Snapins Posted June 29, 2011 Report Share Posted June 29, 2011 Autors pats var slēgt savu topiku. :) Link to comment Share on other sites More sharing options...
Recommended Posts