0

I don't know what I'm doing wrong, but it won't update ever. I know all the variables work because I've posted them in several places, I've echoed them out, copied that and put it into the query and it's worked, and I've copied it to an entirely different page and it's worked. The one page I need it to work on, it decides not to work. I've gone through and checked the code several times as well, but for some reason it's deciding not to work. I changed the code to two lines, because I thought there might have been a problem on one line.

I've read through many posts and I've tried different things, but I'm not getting any results :(

$u = "UPDATE Profile SET Image = '$f ' WHERE Forum = '$p'";


mysql_query($u, mysql_connect(host, username, pass));
5
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by raju_boini525
1

The mysql_query does not know what database to perform the action on.

$link = mysql_connect('host', 'username', 'pass');
mysql_select_db('database');
$u = "UPDATE Profile SET Image = '$f' WHERE Forum = '$p'";
mysql_query($u, $link);
Votes + Comments
well said ;)
0

you need to connect select database then query, in that order for thing to work.
although if you are using dreamweaver templates sometimes it meses with things.

$conn = mysql_connect('host', 'user', 'pass');
mysql_select_db('database_name');
$sql = "UPDATE Profile SET Image = '$f' WHERE Forum = '$p'";
mysql_query($sql, $conn);

Hope this helps :)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.