adam1991 Posted April 29, 2009 Share Posted April 29, 2009 Elo im new here, sorry if this is in the wrong section apologies if it is! Now.. I have a homepage and a admin page there is a form in the admin page that changes the information on the homepage, ive got that all set up now ive got the information to show on the homepage but when i want to change the information on the homepage again it still shows the old message, and creates a NEW entry, ive tried UPDATE but just get errors if i change anything.. i will post my MYSQL code incase Y'all need it $result = mysql_query("SELECT * FROM `message") or die(mysql_error()); $result = mysql_query("DELETE FROM `phptest`.`message` WHERE `message`.`id` IS NULL LIMIT 1;") or die(mysql_error()); $result = mysql_query("SELECT * FROM `message` WHERE 1") or die(mysql()); As you can see i also tried the DELETE function aswell but that just deletes all the entrys, so thats wrong aswell.. Hope i have made some sense if not ill rephrase it some how lol thanks for the help Adam Quote Link to comment https://forums.phpfreaks.com/topic/156122-data-from-the-database/ Share on other sites More sharing options...
revraz Posted April 29, 2009 Share Posted April 29, 2009 Let's see your UPDATE code as well as the Error you received from it. Quote Link to comment https://forums.phpfreaks.com/topic/156122-data-from-the-database/#findComment-821820 Share on other sites More sharing options...
adam1991 Posted April 29, 2009 Author Share Posted April 29, 2009 $result = mysql_query("UPDATE `phptest`.`message` SET `message` = 'This is the message that will appear on the homepage' WHERE `message`.`id` =1 LIMIT 1 ;") or die(mysql_error()) The error what i got just field up the whole page with crap about php and server error, it doesnt go away till u correct the code. Quote Link to comment https://forums.phpfreaks.com/topic/156122-data-from-the-database/#findComment-821826 Share on other sites More sharing options...
fenway Posted April 29, 2009 Share Posted April 29, 2009 The error what i got just field up the whole page with crap about php and server error, it doesnt go away till u correct the code. Um, no. If you can't get a proper die() statemnt to work, there are other problems. Quote Link to comment https://forums.phpfreaks.com/topic/156122-data-from-the-database/#findComment-821828 Share on other sites More sharing options...
adam1991 Posted April 29, 2009 Author Share Posted April 29, 2009 Crap :-\ Quote Link to comment https://forums.phpfreaks.com/topic/156122-data-from-the-database/#findComment-821838 Share on other sites More sharing options...
fenway Posted April 29, 2009 Share Posted April 29, 2009 Get back to the point where there are no php errors -- comment out all of your code if you have to. Quote Link to comment https://forums.phpfreaks.com/topic/156122-data-from-the-database/#findComment-822034 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.