Members Login.
 

Please register HERE to be part of our Community
Contest of the Day.
 
Current Promotions.
 
Refer your friends to this forum and earn BRL per referred member.

Post a New Thread anywhere on Web Development Board to earn BRL$ 5 for every thread. Post a New Reply there and earn BRL$ 3 for every reply.

Post a New Thread anywhere on Search Engine Optimization Board and earn BRL$ 5 for every thread.
Earn By Posting
 
Participate in forum and Earn $$$.

Get Referrer Credit - BRL$ 20
Get Positive Rep Cr. - BRL$ 3
Get New Thread Cr.- BRL$ 3
Get Posting Cr. - BRL$ 2
Get Post size Credit

Full List of BRL$ Earnings
Sponsors.
 


PHP Discussion related to PHP web development, PHP coding. Tutorials, source code, tips and tricks related to PHP programming.

   

MySQL update error usin $var help...


This is a discussion on MySQL update error usin $var help... within the PHP forums, part of the Web Development category; heyi am making a settins thingfor the charity site im doing... and i oly noticedafter a twea because i realised ...

Reply
  #1 (permalink)  
Old 07-21-2007
Administrator

Join Date: Jun 2007
Posts: 3,729
BRL$: 35,043.90
Thanks: 0
Thanked 7 Times in 7 Posts
Rep Power: 406
Rss_Feeds is on a distinguished road
Default MySQL update error usin $var help...

heyi am making a settins thingfor the charity site im doing... and i oly noticedafter a twea because i realised it wasnt touching the db why... im using PHP:---------$what_to_update = ''; switch ($sub) { case 'general': $what_to_update = "title='$title', donations='$donations', sitesearch='$sitesearch', siteurl='$siteurl', showlogo='$showlogo', webmaster_email='$webmaster_email', general_email='$general_email'"; break; case 'meta': $what_to_update = "meta_author='$meta_author', meta_keywords='$meta_keywords', meta_robots='$meta_robots'"; break; case 'footer': $what_to_update = "footer1='$footer1', footer2='$footer2', footer3='$footer3'"; break; case 'style': $what_to_update = "style='$sitestyle'"; break; case 'error': $what_to_update = "error_status='$error_status', error_404_level='$error_404_level'"; break; case 'sitelock': $what_to_update = "sitelock='$sitelock', sitelock_msg='$sitelock_msg'"; break; case 'news': $what_to_update = "latest_news='$latest_news'"; break; } $result = mysql_query("UPDATE settings SET $what_to_update WHERE id='1'", $link_db) or die ('Error updateing. Conatct admin. SQL ERROR: '.mysql_error());--------- that to decie whats being updated, but im getting the following error.Code:---------Error updateing. Conatct admin. SQL ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE id='1'' at line 1--------- plz help its probally something simple. but i have no clueDan


To view links or images in this forum your post count must be 1 or greater. You currently have 0 posts.
__________________
High Quality
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.

Powerful
To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.


To receive latest updates about BRL Forums, Subscribe to Latest Updates Thread.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
$var, error, help..., mysql, update, usin


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

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
UPDATE MySQL Error Rss_Feeds PHP 0 07-18-2007 01:01 AM
time delay on mysql update? Rss_Feeds PHP 0 07-15-2007 08:37 PM
mysql acess denied problem Rss_Feeds PHP 0 07-15-2007 08:37 PM
MySQL General: Help: Unable to start MySQL in linux mr_atom mySQL Database 0 07-09-2007 07:03 AM
How do i join 2 different queries (select and update in MySql) mr_atom mySQL Database 0 07-09-2007 07:03 AM


 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105