Web Hosting Talk







View Full Version : Editing MySQL tables in PHP


FasterUpload
02-11-2008, 09:20 PM
I have a MySQL table, and a PHP admin panel to say.

Now I want to edit the data in the MySQL table.

How would I parse the database and edit it using PHP?

Sorry it's a newbie question but it's always good to ask than never :)

Thanks

Dan L
02-11-2008, 09:43 PM
http://us2.php.net/mysql

devonblzx
02-11-2008, 11:19 PM
Why not use PHPMyAdmin?

FasterUpload
02-12-2008, 06:59 AM
Ok maybe I asked wrongly.

I'm trying to use a text field to edit the data from a MySQL database.

So I select the database, then now I have the content on the PHP page. How can I moreso edit it in a text field?

Codebird
02-12-2008, 09:41 AM
you edit the text field then u submit your form in the page of the form action you write

$whatever=$_POST/$_GET["textfield_name"];
mysql_query(UPDATE table_name SET field_name=$whatever WHERE condition);

FasterUpload
02-12-2008, 05:17 PM
Sounds good thanks!

Codebird
02-12-2008, 05:22 PM
mysql_query("UPDATE table_name SET field_name=$whatever WHERE condition");

I forgot the quotations put them