thebobby Posted January 10, 2013 Share Posted January 10, 2013 line 44 $maxtopic_id = mysql($db_name, "SELECT topicid FROM game_topic WHERE date2=\"$clock2\""); line 45 $mtid = mysql_result($maxtopic_id,"mtid"); Deprecated: mysql() [function.mysql]: This function is deprecated; use mysql_query() instead in /home/mafiacri/public_html/massmail.php on line 44 Warning: mysql_result() expects parameter 2 to be long, string given in /home/mafiacri/public_html/massmail.php on line 45 Quote Link to comment Share on other sites More sharing options...
Someone Posted January 10, 2013 Share Posted January 10, 2013 use mysql_query() instead in /home/mafiacri/public_html/massmail.php on line 44 Do as it says :) $maxtopic_id = mysql_query($db_name, "SELECT topicid FROM game_topic WHERE date2=\"$clock2\""); I _think_ the other error will sort it self. In general, when getting such error, just Google the first part of the error (IE: Deprecated: mysql() [function.mysql]: This function is deprecated; use mysql_query() instead in), without the custom to you data. Millions have prob had the issue before you did. Quote Link to comment Share on other sites More sharing options...
thebobby Posted January 10, 2013 Author Share Posted January 10, 2013 Warning: mysql_query() expects parameter 2 to be resource, string given in /home/mafiacri/public_html/massmail.php on line 44 Warning: mysql_result() expects parameter 1 to be resource, null given in /home/mafiacri/public_html/massmail.php on line 45 Quote Link to comment Share on other sites More sharing options...
Someone Posted January 10, 2013 Share Posted January 10, 2013 Ooops did not read that fully. You digging up 1996 or something. $mtid = mysql_query("SELECT topicid FROM game_topic WHERE date2=\"$clock2\""); // possibley not needed ine 45 $mtid = mysql_result($maxtopic_id,"mtid"); If that fails, post me the database connection details, usually in a file named something like db.php or config.php Quote Link to comment Share on other sites More sharing options...
thebobby Posted January 10, 2013 Author Share Posted January 10, 2013 Warning: mysql_query() expects parameter 2 to be resource, string given in /home/mafiacri/public_html/massmail.php on line 44 line 45 error gone Quote Link to comment Share on other sites More sharing options...
Someone Posted January 10, 2013 Share Posted January 10, 2013 $mtid = mysql_query("SELECT topicid FROM game_topic WHERE date2='$clock2'"); Prob wont help but worth a try. I think you need to look at the database connection. As I dont think a connection has been made, nor a database selected. Changing this will lead to a chain reaction, and when that is done. mysql_query is decapitated in PHP 5.5.0 Purhasp someone who is working with this engine will be able to help Quote Link to comment Share on other sites More sharing options...
Djkanna Posted January 10, 2013 Share Posted January 10, 2013 $maxtopic_id = mysql_query ( 'SELECT `topicid` FROM `game_topic` WHERE (`date2` = "'.$clock2.'")' ); //Should check there is rows first... $mtid = mysql_result ( $maxtopic_id ); echo $mtid; Quote Link to comment Share on other sites More sharing options...
thebobby Posted January 10, 2013 Author Share Posted January 10, 2013 Same error for both code it is php 5.3 this all worked before the upgrade to php 5.3. Lol hate upgrades lol its for mass mail and it works fine i am only one to see error but i just hate errors Quote Link to comment Share on other sites More sharing options...
a_bertrand Posted January 10, 2013 Share Posted January 10, 2013 Well other option if you don't manage to fix it (which honestly should not be hard, just check the PHP manual), you could always change engine ;) Quote Link to comment Share on other sites More sharing options...
thebobby Posted January 10, 2013 Author Share Posted January 10, 2013 line 91 $maxtopic_id = mysql_query ( 'SELECT `topicid` FROM `game_topic` WHERE (`date2` = "'.$clock2.'")' ); line92 //Should check there is rows first... line 93 $mtid = mysql_result ( $maxtopic_id ); line 94 echo $mtid; Warning: mysql_result() expects at least 2 parameters, 1 given in /home/mafiacri/public_html/forum.php on line 93 every file with this code shows same error but all works. this started when host went to php 5.3 Quote Link to comment Share on other sites More sharing options...
bluegman991 Posted January 10, 2013 Share Posted January 10, 2013 (edited) mysql_query requires parameter 2 to be a connection id, if there is no previously opened connection in your current session. So with that being said... Are you connecting to the database. (Is the file where you connect to your db being included or are you connecting in the current file?) Edited January 12, 2013 by bluegman991 Quote Link to comment Share on other sites More sharing options...
thebobby Posted January 10, 2013 Author Share Posted January 10, 2013 line 88 mysql_query("INSERT INTO game_topic (gang, cat_id, forum_type, topic, date, date2, date2_year, origin, origin_userid) line 89 VALUES (\"$user_class->gang\", \"$cat_id\", \"$forum\", \"$topic\", \"$clock\", \"$clock2\", \"$clock2_year\", \"$user_class->username\", \"$user_class->id\") "); line 91 $maxtopic_id = mysql($db_name, "SELECT topicid FROM game_topic WHERE date2=\"$clock2\""); line 92 $mtid = mysql_result($maxtopic_id,$mtid); line 94 mysql_query("INSERT INTO game_posts (cat_id,topicid, message, date, date2, poster, poster_userid) line 95 VALUES ('$cat_id','$mtid', \"$message\", '$clock', '$clock2', \"$user_class->username\", \"$user_class->id\") "); $notice = "The topic has been posted."; Quote Link to comment Share on other sites More sharing options...
thebobby Posted January 10, 2013 Author Share Posted January 10, 2013 Deprecated: mysql() [function.mysql]: This function is deprecated; use mysql_query() instead in /home/mafiacri/public_html/forum.php on line 91 Warning: mysql_query() expects parameter 2 to be resource, string given in /home/mafiacri/public_html/forumil.php on line 91 Warning: mysql_result() expects parameter 1 to be resource, null given in /home/mafiacri/public_html/forum.php on line 92 get these error when i change line 91 $maxtopic_id = mysql_query($db_name, "SELECT topicid FROM game_topic WHERE date2=\"$clock2\""); beforeline 91 $maxtopic_id = mysql($db_name, "SELECT topicid FROM game_topic WHERE date2=\"$clock2\""); Quote Link to comment Share on other sites More sharing options...
a_bertrand Posted January 11, 2013 Share Posted January 11, 2013 Those are all of the same problem, apply what you have been told to and you should be up and running. Quote Link to comment Share on other sites More sharing options...
thebobby Posted January 12, 2013 Author Share Posted January 12, 2013 Apply wat line 88 mysql_query("INSERT INTO game_topic (gang, cat_id, forum_type, topic, date, date2, date2_year, origin, origin_userid) line 89 VALUES (\"$user_class->gang\", \"$cat_id\", \"$forum\", \"$topic\", \"$clock\", \"$clock2\", \"$clock2_year\", \"$user_class->username\", \"$user_class->id\") "); line 91 $maxtopic_id = mysql($db_name, "SELECT topicid FROM game_topic WHERE date2=\"$clock2\""); line 92 $mtid = mysql_result($maxtopic_id,$mtid); line 94 mysql_query("INSERT INTO game_posts (cat_id,topicid, message, date, date2, poster, poster_userid) line 95 VALUES ('$cat_id','$mtid', \"$message\", '$clock', '$clock2', \"$user_class->username\", \"$user_class->id\") "); $notice = "The topic has been posted."; Quote Link to comment Share on other sites More sharing options...
Someone Posted January 12, 2013 Share Posted January 12, 2013 (edited) thebobby, Mysql requires parameter 2 to be a connection id, if there is no previously opened connection in your current session. So with that being said... Are you connecting to the database. (Is the file where you connect to your db being included or are you connecting in the current file?) I requested that you post the database connection details. I seriously think you need to learn some basic things before attempting to get this running. Things such as: http://www.php-mysql-tutorial.com/wikis/mysql-tutorials/connect-to-mysql-database.aspx Edited January 12, 2013 by Someone think there was confusion regarding who the msg was for :) Quote Link to comment Share on other sites More sharing options...
Someone Posted January 12, 2013 Share Posted January 12, 2013 Just don't post the database connection password. He is updating an old method to connecting to mysql. So no connection has been made. Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted January 12, 2013 Share Posted January 12, 2013 Take a look at your line 88 and line 91, see the difference? You should now change line 91 to look the same as 88. It should look something like this line 91 $maxtopic_id = mysql_query("SELECT topicid FROM game_topic WHERE date2=\"$clock2\""); line 92 $mtid = mysql_fetch_assoc($maxtopic_id); Also please use code tags. It makes it easier to read 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.