Jump to content

[SOLVED] Update MYsql and PHP


TheFilmGod

Recommended Posts

How can I update a whole row at a time. I know you can update each value one at a time, but I want to do the whole row, a lot like insert does it!

 

This is what I got so far:

 

$query="UPDATE DOCS SET notes=$notes where title=$title";

mysql_query($query); 

 

- I'm a noob.

Link to comment
https://forums.phpfreaks.com/topic/67533-solved-update-mysql-and-php/
Share on other sites

Thanks for the fast reply!

 

I had another question. I currently fell into a trap with my script.

 

Mysql table:

 

id | title | des | notes

 

I have the title of the row and I want to find out the id. So title = $title. How would I query the mysql table to find the row where title='$title' and then retrieve the id of that row?

Have you heard of SELECT?

 

I think you need to read some basic MYSQL tutorials.

 

Yes I have. But its confusing. I just got in mysql and php. And I have this huge book that talks everything about php and when it gets to mysql it totally wings it. The mysql chapter takes like 20 pages. And the whole book is over 700.

 

This is what I think will work:

 

$id_row = mysql_query ( "SELECT * FROM docs WHERE title='$title'");
	mysql_fetch_assoc($id_row);

 

If that works I know how to go on from there. All I want to do is select the row where title='$title'

 

Sorry if I'm bothering you with such a newbie question, I'm just stupid...

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.