Goke Posted April 28, 2014 Report Share Posted April 28, 2014 Majoritatea site-urilor au genul asta de mesaj atunci cand sunt vulnerabile la sqlWARNING: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''1''' at line 1Insa altele , apar cu txt mare , frumos asezate intr-un tabel , cu un border rosu .. si mai sunt si alte genuri de asezare in pagina a eroriiam incercat si eu insa nu stiu cum sa fac sa apar precum sunt acele exemple de mai sus..-am folosit :<?php$cn=mysql_connect("mysql.hostinger.ro","test","testTestos") or die(mysql_error());mysql_select_db("test");$Sql="select * from TestDeTestoasa where id='".$_GET['id']."'";echo $Sql;$rez=mysql_query($Sql);$rand=mysql_fetch_array($rez);if($rand!=false){echo $rand['id'];echo $rand['title']."<br>";echo $rand['text']."<br>";<!-------ACI` CRED CA TREBUIE SA SCHIMB CATE CEVA}elseecho mysql_errno() . ' : ' . @Mysql_error() ;PANA ACI`-----------!>?>Insa vreau ca de ex eroarea sa apara tot intr-un bordereroarea mea :select * from TestDeTestoasa where id='1''1064 : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''1''' at line 1Inca ceva , de ce apare si aceasta chestie si cum o pot scoate din pagina.select * from TestDeTestoasa where id='1'' Quote Link to comment Share on other sites More sharing options...
BGS Posted April 28, 2014 Report Share Posted April 28, 2014 (edited) iti apare select * from TestDeTestoasa where id='1'' deoarece ai un echo $Sql; iar pentru border trebuie sa dai echo si la niste html, astfel: echo "<h1 style='border:2px black solid; font-size:18px;'> " . mysql_errno() . ' : ' . Mysql_error() . '</h1>'; Edited April 28, 2014 by BGS Quote Link to comment Share on other sites More sharing options...
Goke Posted April 28, 2014 Author Report Share Posted April 28, 2014 am incercat si eu cu elemente html dar nu mi-a mers , sigur nu am pus "multumesc mult Quote Link to comment Share on other sites More sharing options...