SQL Query problem
Posted: Mon Mar 06, 2006 12:16 am
I want to setup my main page to pull from the database for the main news story url and snippet, I've set that end up and it works.
I want to be able to submit changes to the database via a form for my staff who aren't that tech savvy. I don't know what code to use to tell it to replace the row of the table. It's the only row on the table but if I refer to specifics to replace the code will be invalid on it's next use as they have changed. Is there a way to tell it to delete that row and create a new one? still have a problem with specifics though.
EDIT:
I ran this successfully through phpmyadmin
UPDATE `mainpage` SET `pictureurl` = '3',
`storyurl` = '5',
`headline` = '213',
`snippet` = '2' WHERE `pictureurl` = '%' AND `storyurl` = '%' AND `headline` = '%' AND `snippet` = '%' LIMIT 1 ;
Problem is that it says zero rows affected, how do I change that?
I want to be able to submit changes to the database via a form for my staff who aren't that tech savvy. I don't know what code to use to tell it to replace the row of the table. It's the only row on the table but if I refer to specifics to replace the code will be invalid on it's next use as they have changed. Is there a way to tell it to delete that row and create a new one? still have a problem with specifics though.
EDIT:
I ran this successfully through phpmyadmin
UPDATE `mainpage` SET `pictureurl` = '3',
`storyurl` = '5',
`headline` = '213',
`snippet` = '2' WHERE `pictureurl` = '%' AND `storyurl` = '%' AND `headline` = '%' AND `snippet` = '%' LIMIT 1 ;
Problem is that it says zero rows affected, how do I change that?