jd2007 Posted July 20, 2007 Share Posted July 20, 2007 <?php $id=$_GET["varj"]; $gname=$_GET["varg"]; $grom_no=$_GET["varh"]; $glink=$_GET["vark"]; $db=mysql_connect("localhost", "root") or die(mysql_error()); mysql_select_db("ndsrom"); $query="update games set name=$gname where id=$id"; $result=mysql_query($query); $query2="update games set romno=$grom_no where id=$id"; $result2=mysql_query($query2); $query3="update games set link=$glink where id=$id"; $result3=mysql_query($query3); if ($result && $result2 && $result3) { $edit="<br><br>Game succesfully edited!"; header("location:index.php?var10=$edit"); } else { $edit2="<br><br>ERROR!"; header("location:index.php?var11=$edit2"); } ?> it always results in error ! Link to comment https://forums.phpfreaks.com/topic/60963-whats-wrong-with-my-code-below/ Share on other sites More sharing options...
pocobueno1388 Posted July 20, 2007 Share Posted July 20, 2007 Try putting a die statement at the end of each query to make sure there aren't any problems with the queries. $result=mysql_query($query)or die(mysql_error()); Link to comment https://forums.phpfreaks.com/topic/60963-whats-wrong-with-my-code-below/#findComment-303348 Share on other sites More sharing options...
Crew-Portal Posted July 20, 2007 Share Posted July 20, 2007 Fist Off Your MySQL Connection is unsecure! if you do have a password set up it should look more like this mysql_connect(localhost, root, password, database); Link to comment https://forums.phpfreaks.com/topic/60963-whats-wrong-with-my-code-below/#findComment-303349 Share on other sites More sharing options...
pedrobcabral Posted July 20, 2007 Share Posted July 20, 2007 What do you mean by unsecure? If it is without password, if you can't put files into the server of 'someone' is it still not safe? Link to comment https://forums.phpfreaks.com/topic/60963-whats-wrong-with-my-code-below/#findComment-303351 Share on other sites More sharing options...
Crew-Portal Posted July 20, 2007 Share Posted July 20, 2007 If your mysql database has no password than anyone could log on to it using name root on the cmd prompty and add records read confedental information get other users passwords flood, drop, and erase your databases! Do you think google has a password set up! Of course they do because without it the mysql is UNSECURE! Link to comment https://forums.phpfreaks.com/topic/60963-whats-wrong-with-my-code-below/#findComment-303354 Share on other sites More sharing options...
jd2007 Posted July 21, 2007 Author Share Posted July 21, 2007 thanks, buddy Link to comment https://forums.phpfreaks.com/topic/60963-whats-wrong-with-my-code-below/#findComment-303869 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.