Jump to content

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

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.