Current location: Hot Scripts Forums » Programming Languages » PHP » php mysql basic query NO WORK help please


php mysql basic query NO WORK help please

Reply
  #1 (permalink)  
Old 03-17-04, 11:22 AM
mavoric mavoric is offline
Newbie Coder
 
Join Date: Feb 2004
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy php mysql basic query NO WORK help please

ok, i have this small script, that updates my phpbb database, but it doesn't. I can't find anything worng with it, and all the password etc is correct, so please help. Here is the query
PHP Code:

<?


$db 
mysql_connect("localhost""username""password");
mysql_select_db("database",$db);
$result mysql_query("update phpbb_users set user_profcolour=blue, user_profbordcolour=pink where user_id=3",$db);

?>
and well it doesn't update it. Those rows and columns exsist, and im stumped please help

Thanks in advance
Reply With Quote
  #2 (permalink)  
Old 03-17-04, 11:26 AM
Infinite_Hackers's Avatar
Infinite_Hackers Infinite_Hackers is offline
Coding Addict
 
Join Date: Dec 2003
Posts: 307
Thanks: 0
Thanked 0 Times in 0 Posts
you don't really need the $db in the mysql_query
Reply With Quote
  #3 (permalink)  
Old 03-17-04, 11:34 AM
NeverMind's Avatar
NeverMind NeverMind is offline
Community VIP
 
Join Date: Aug 2003
Location: K.S.A
Posts: 2,257
Thanks: 0
Thanked 2 Times in 1 Post
Quote:
Originally Posted by Infinite_Hackers
you don't really need the $db in the mysql_query
the problem isn't in that!!

use this query to check if mysql will turn any error:
PHP Code:

$db mysql_connect("localhost""username""password")or

die(
mysql_error());

mysql_select_db("database",$db)or
die(
mysql_error());

$result mysql_query("update phpbb_users set user_profcolour=blue, user_profbordcolour=pink where user_id=3",$db)or
die(
mysql_error()); 
if there is any problem in mysql this should tell you about it..
__________________
PHPSimplicity
We don't need a reason to help people - Zidane [FF9]
Reply With Quote
  #4 (permalink)  
Old 03-17-04, 11:37 AM
mavoric mavoric is offline
Newbie Coder
 
Join Date: Feb 2004
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
nope, it still doesn't work
Reply With Quote
  #5 (permalink)  
Old 03-17-04, 11:38 AM
mavoric mavoric is offline
Newbie Coder
 
Join Date: Feb 2004
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
actually, i sorted it out, never mind, thanks for your help though
Reply With Quote
  #6 (permalink)  
Old 03-17-04, 11:46 AM
jrave jrave is offline
Newbie Coder
 
Join Date: Mar 2004
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
oops... posted a bit too late... just erasing to save what ever embarrasment i can

Last edited by jrave; 03-17-04 at 11:49 AM.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP and MySQL ? rob2132 Hot Scripts Forum Questions, Suggestions and Feedback 4 08-29-08 02:22 AM
The Art Nexus seeking PHP programmers TheArtNexus Job Offers & Assistance 5 02-26-08 03:08 AM
Declared Functions skipper23 PHP 4 12-17-03 10:06 AM
index page not showing up skipper23 PHP 3 12-15-03 01:10 PM
PHP and Mysql Query ivan PHP 4 12-08-03 10:49 PM


All times are GMT -5. The time now is 10:20 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.