Jump to content

Data from the database..


adam1991

Recommended Posts

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

Link to comment
Share on other sites

$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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.