goma smile Posted December 2, 2008 Report Share Posted December 2, 2008 Man ir jautajums man majaslapa ka Id ir noradits ka vards a tie vardi ir ar atstarpem un keburiem vai ir iespejams vin datus izvilkt ar if(isset($_GET['id']) == 'id' AND $_GET['id']) { } jo kad censos sita man rada mysql eroru a kad id vienta beigas lieku skaitli piemeram 1.,2.,3., ....... tad nerada neko bet kad beigas ielieku piemeram goma smile tad rada to eroru. Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\wamp\www\apskats.php on line 19 Link to comment Share on other sites More sharing options...
Java Posted December 2, 2008 Report Share Posted December 2, 2008 Iedod pilnu skriptu. Link to comment Share on other sites More sharing options...
Aleksejs Posted December 2, 2008 Report Share Posted December 2, 2008 Parādi SQL vaicājuma saturu. Kas attiecas uz to "ifu", pastāsti, ko tieši ar to gribi panākt. Link to comment Share on other sites More sharing options...
xPtv45z Posted December 2, 2008 Report Share Posted December 2, 2008 Lieku alu uz to, ka teksts vaicājumā, ir bez pēdiņām. Link to comment Share on other sites More sharing options...
goma smile Posted December 2, 2008 Author Report Share Posted December 2, 2008 $con = mysql_connect("localhost","root","");if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("gopa", $con); if(isset($_GET['id']) == 'id' AND $_GET['id']) { $ss = mysql_query("SELECT * FROM lietotaji WHERE id = {$_GET['id']}" ); $row = mysql_fetch_array($ss); { echo "".$row['id'].""; } } Link to comment Share on other sites More sharing options...
Delfins Posted December 2, 2008 Report Share Posted December 2, 2008 nu kurš tā mācija rakstīt? Pirms bāz iekšā SQL-ā vērtības, pārbaudi vai nesatur kādu ļaunumu... 100x apspriests. Proble'ma tev ir tajā, ka string vērtības jābūt pēdiņās Link to comment Share on other sites More sharing options...
goma smile Posted December 2, 2008 Author Report Share Posted December 2, 2008 Un latviska tas butu ? Link to comment Share on other sites More sharing options...
anonīms Posted December 2, 2008 Report Share Posted December 2, 2008 a kam tev $row = mysql_fetch_array($ss); { echo "".$row['id'].""; } ? ja vajag tikai $row = mysql_fetch_array($ss); echo "".$row['id']." "; pēdīņas "" vai '' Link to comment Share on other sites More sharing options...
andrisp Posted December 2, 2008 Report Share Posted December 2, 2008 Un latviska tas butu ? To tev drīzāk pašam vajadzētu pajautāt :) Link to comment Share on other sites More sharing options...
goma smile Posted December 2, 2008 Author Report Share Posted December 2, 2008 anonīms uz tavu doto labojumu nereage Link to comment Share on other sites More sharing options...
anonīms Posted December 2, 2008 Report Share Posted December 2, 2008 vispār jau manuprāt divi get nevar būt vienādi if(isset($_GET['id2']) == 'id' AND $_GET['id']) { } Link to comment Share on other sites More sharing options...
xPtv45z Posted December 2, 2008 Report Share Posted December 2, 2008 Kurlais māca aklajam klavieres spēlēt. :) Link to comment Share on other sites More sharing options...
anonīms Posted December 2, 2008 Report Share Posted December 2, 2008 (edited) :D $ss = mysql_query("SELECT * FROM lietotaji WHERE id = '{$_GET['id']}'" ); $ss = mysql_fetch_array($ss); echo "".$ss['id'].""; un vēl mysql_real_escape_string() ? :D Edited December 2, 2008 by anonīms Link to comment Share on other sites More sharing options...
Java Posted December 2, 2008 Report Share Posted December 2, 2008 (edited) if ($_REQUEST['id']) { $id = trim($_REQUEST['id']); } else { $id = ''; } // šeit vajadzētu ielikt arī pārbaudi vai tas $id ir legāls - vai nav kāda injekcija $query = "SELECT * FROM `lietotaji` WHERE `id`='".mysql_real_escape_string($id)."';"; $res = mysql_query($query); Edited December 2, 2008 by Java Link to comment Share on other sites More sharing options...
goma smile Posted December 2, 2008 Author Report Share Posted December 2, 2008 (edited) :O man aizgaja tikai ja tas ir ir skaitlis piemeram 777 bet piemeram goma smile nejiet un rada to eroru :( un links http://manslinks.com/lietotajs?id=[GOMA]%20smile vai ari jebkads vards piemeram http://manslinks.com/lietotajs?id=Anubiss Edited December 2, 2008 by goma smile Link to comment Share on other sites More sharing options...
Recommended Posts