beboo002 Posted August 22, 2007 Share Posted August 22, 2007 i con't understand this problem <?php if($_POST['Submit2']!="") { $link=mysql_connect("localhost","root",""); if(!$link) die("can not connect to mysql"); mysql_select_db("timesheet",$link); /////////////////////////////////////////fetch///////////////////////////// $sql2="select firstName,lastname,address,officeemail,otheremail,phoneno,mobileno,panno,bloodgroup,department,designation,manager,dateofjoining from employeeinfo where name ='".$_POST['text2']."'"; $result2=mysql_query($sql2,$link); //$query1=mysql_fetch_array($result1); echo "<table border=1 align = center> <tr> <th>firstName</th> <th>lastname</th><th>address</th> <th>officeemail</th><th>otheremail</th> <th>phoneno</th><th>mobileno</th> <th>panno</th><th>bloodgroup</th><th>deportment</th> <th>designation</th><th>manager</th><th>dateofjoining</th></tr>"; while($row1 = mysql_fetch_array($result2)) { echo "<tr><td>"; echo $row1['firstName']; echo "</td>"; echo "<td>"; echo $row1['lastname']; echo "<td>"; echo $row1['address']; echo "<td>"; echo $row1['officeemail']; echo "<td>"; echo $row1['otheremail']; echo "<td>"; echo $row1['phoneno']; echo "<td>"; echo $row1['mobileno']; echo "<td>"; echo $row1['panno']; echo "<td>"; echo $row1['bloodgroup']; echo "<td>"; echo $row1['department']; echo "<td>"; echo $row1['designation']; echo "<td>"; echo $row1['manager']; echo "<td>"; echo $row1['dateofjoining']; echo "</td></tr>"; } echo "</table>"; mysql_close($link); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/66155-solved-warning-supplied-argument-is-not-a-valid-mysql-result-resource-in-capachehtd/ Share on other sites More sharing options...
AndyB Posted August 22, 2007 Share Posted August 22, 2007 Change: $result2=mysql_query($sql2,$link); to: $result2=mysql_query($sql2,$link) or die("Error: ". mysql_error(). " with query ". $sql2); And if it's not obvious what needs to be fixed, post the result of that change here. Quote Link to comment https://forums.phpfreaks.com/topic/66155-solved-warning-supplied-argument-is-not-a-valid-mysql-result-resource-in-capachehtd/#findComment-330922 Share on other sites More sharing options...
beboo002 Posted August 22, 2007 Author Share Posted August 22, 2007 thanks for reply warning is remove but there is no data shown in table. Quote Link to comment https://forums.phpfreaks.com/topic/66155-solved-warning-supplied-argument-is-not-a-valid-mysql-result-resource-in-capachehtd/#findComment-330930 Share on other sites More sharing options...
AndyB Posted August 22, 2007 Share Posted August 22, 2007 Do you mean you no longer get the 'not a valid ...' error message? I assume means that you corrected something in your script. If so, we need to see what you now have assuming you mean the script works but does not display any data even though you have data in the table. If I misunderstood, what's the present problem? Quote Link to comment https://forums.phpfreaks.com/topic/66155-solved-warning-supplied-argument-is-not-a-valid-mysql-result-resource-in-capachehtd/#findComment-330933 Share on other sites More sharing options...
beboo002 Posted August 22, 2007 Author Share Posted August 22, 2007 i hav emplyee info table in mysql i want to fetch the record in table and store something like this firstName lastname address officeemail otheremail phoneno mobileno panno bloodgroup deportment designation manager dateofjoining table is printing but record are not found thats my problem where goes my record for above code i hav change in my where cluse officeemail insted of name. Quote Link to comment https://forums.phpfreaks.com/topic/66155-solved-warning-supplied-argument-is-not-a-valid-mysql-result-resource-in-capachehtd/#findComment-330938 Share on other sites More sharing options...
AndyB Posted August 22, 2007 Share Posted August 22, 2007 After you define your query string ($sql2), add a new line of code: echo $sql2; Then you'll know for certain just what query is being passed to the database. If that doesn't make the solution obvious, post what output it gives. Quote Link to comment https://forums.phpfreaks.com/topic/66155-solved-warning-supplied-argument-is-not-a-valid-mysql-result-resource-in-capachehtd/#findComment-330951 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.