JankaZ Posted April 8, 2010 Share Posted April 8, 2010 <form method="post"> Jautajums: <input name="jautajums" type="text" /> <input type="submit" value="Jautat" /> <?php $conectdb = mysql_connect("localhost","root","1991jz9969470"); if (!$conectdb) { die('Could not connect: ' . mysql_error()); } mysql_select_db("db", $conectdb); $atbilde = mysql_result(mysql_query("SELECT atbilde FROM bot WHERE jautajums='".$_POST['jautajums']."'")); echo $atbilde; ?> <br /> <? echo("Tu: $jautajums"); ?> <br /> <? echo("Bots: $atbilde"); ?> Plzz help with this error jautajums = question atbilde = answer Quote Link to comment https://forums.phpfreaks.com/topic/197971-wrong-parameter-count-for-mysql_result/ Share on other sites More sharing options...
trq Posted April 8, 2010 Share Posted April 8, 2010 The error says it all, mysql_result expects at least two arguments. Quote Link to comment https://forums.phpfreaks.com/topic/197971-wrong-parameter-count-for-mysql_result/#findComment-1038837 Share on other sites More sharing options...
JankaZ Posted April 8, 2010 Author Share Posted April 8, 2010 plzz ken you fix it or give som example! Quote Link to comment https://forums.phpfreaks.com/topic/197971-wrong-parameter-count-for-mysql_result/#findComment-1038839 Share on other sites More sharing options...
oni-kun Posted April 8, 2010 Share Posted April 8, 2010 The error says it all, mysql_result expects at least two arguments. Quote Link to comment https://forums.phpfreaks.com/topic/197971-wrong-parameter-count-for-mysql_result/#findComment-1038840 Share on other sites More sharing options...
JankaZ Posted April 8, 2010 Author Share Posted April 8, 2010 I dont ander stand it! Quote Link to comment https://forums.phpfreaks.com/topic/197971-wrong-parameter-count-for-mysql_result/#findComment-1038855 Share on other sites More sharing options...
oni-kun Posted April 8, 2010 Share Posted April 8, 2010 I dont ander stand it! What do you not understand? The second parameter of mysql_result should be the row index you wish to output. Why are you using code that you don't even understand. Quote Link to comment https://forums.phpfreaks.com/topic/197971-wrong-parameter-count-for-mysql_result/#findComment-1038862 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.