ArcAiN6 Posted September 9, 2006 Share Posted September 9, 2006 I've been tweaking this for a while now, and i still can't seem to get it to work,... If anyone has any suggestions, or ideas, please let me know what could possibly be wrong with this script.. I recieve an error, but as i'm not very good with MySQL i haven't the faintest idea how to fix it.. [code]<?php//Edit before execution// change below is your assigned mySQL username$user = "xxxxxxxxxx";// change to the pw below is your assigned mySQL password$pw = "xxxxxxxxx";// change to the database you have permission to connect to$db = "xxxx"; //Set current Date-time we need two I to display two minute digits$date = date('l dS \of F Y h:II:s A'); // Connect to the database server $dbcnx = @mysql_connect("localhost", $user, $pw); if (!$dbcnx) { echo( "<p>Unable to connect to the " . "database server at this time.</p>"); exit();}mysql_select_db($db, $dbcnx);$sql = "UPDATE ibf_members,ibf_member_extra SET ibf_members.mgroup=5, ibf_member_extra.signature= \"Banned on:" .$date ." by nExfUn script\" WHERE ibf_members.id=ibf_member_extra.id AND ibf_members.mgroup=151 AND ibf_members.posts<20 AND ibf_members.joined< UNIX_TIMESTAMP()-2592000;";if ( @mysql_query($sql) ) { echo("<p>Update affected " . mysql_affected_rows() . "rows.</p>");} else { echo("<p>Error performing update: " . mysql_error() ."</p>");}?>[/code]an online buddy did the SQL portion for me, but he's not been online for almost a week now, and i get the following error when i try to run the script:[quote]Error performing update: You have an error in your SQL syntax near 'ibf_member_extra SET ibf_members.mgroup=5, ibf_member_extra.signature= "Banned' at line 1[/quote]any help would be most appreciated :)-=[ ArcAiN6 ]=- Quote Link to comment Share on other sites More sharing options...
Guest WarpNacelle Posted September 9, 2006 Share Posted September 9, 2006 Hi,The error your getting is indicating a problem with UPDATE query.I believe the error is with this line:[code]ibf_member_extra.signature= \"Banned on:" .$date ." by nExfUn script\"[/code]Try either:[code]<?php ibf_member_extra.signature= 'Banned on: $date by nExfUn script'?>[/code]or[code]ibf_member_extra.signature= \"Banned on:\" .$date .\" by nExfUn script\"[/code]I think he didn't use the quotes quite right.I think that will work. Quote Link to comment Share on other sites More sharing options...
ArcAiN6 Posted September 9, 2006 Author Share Posted September 9, 2006 hmm... somethign isn't right somewhere... maybe it's on my system, but neither suggestion worked.. I'm stillr ecieving the error... Quote Link to comment Share on other sites More sharing options...
Guest WarpNacelle Posted September 9, 2006 Share Posted September 9, 2006 Darn.It's got to be that line...If I take it out of the query and send it through phpMyAdmin it checks out.Shoot man - I don't know what to suggest. Enclosing the value in single quotes should have taken care of it.Is it the exact same error or did it change slightly? Quote Link to comment Share on other sites More sharing options...
jefkin Posted September 9, 2006 Share Posted September 9, 2006 That error happened with the ',' between your two table names 'ibf_members,ibf_member_extra'that suggests to me that your MySQL can't handle the 2 table update.You could break the statement up into 2 updates instead, or maybe upgrade your MySQL.Jeff Quote Link to comment Share on other sites More sharing options...
redarrow Posted September 9, 2006 Share Posted September 9, 2006 do 2 updates ok then fine ok. Quote Link to comment Share on other sites More sharing options...
ArcAiN6 Posted September 9, 2006 Author Share Posted September 9, 2006 WEE... IT's ALIVE!!!I upgraded my MySQL server... evidently it was woefully out of date (v3.32.x) thank you guys so very much for the help :) all is peachy keen now :) Quote Link to comment Share on other sites More sharing options...
Guest WarpNacelle Posted September 9, 2006 Share Posted September 9, 2006 [quote author=ArcAiN6 link=topic=107429.msg431106#msg431106 date=1157785761]I upgraded my MySQL server... evidently it was woefully out of date (v3.32.x) [/quote]Wow! No wonder. Very good thing to update! ;DGlad it's going now. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.