Jump to content

mtvaran

Members
  • Posts

    61
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

mtvaran's Achievements

Member

Member (2/5)

0

Reputation

  1. yes now it works. i had to take echo mysql_error(); off. previously i put it for error finding. thanks guys for your kind help.
  2. this is my full query for searching data from multiple table. still i could not get any result. could anyone check please where am i made mistake? <?php $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("uni", $con); $sql = " SELECT take.StudentID ,student.StudentName ,take.CourseID ,course.CourseName FROM take ,student ,course WHERE take.StudentID = student.StudentID AND take.CourseID = course.CourseID AND take.StudentID LIKE '$_POST[sid]%' ORDER BY take.StudentID ASC "; $result = mysql_query($sql) or trigger_error('MySQL Error: ' . mysql_error(), E_USER_ERROR); echo"<br>"; echo "<center><table width=700 border=1>"; echo "<tr><th>StudentID</th><th>StudentName</th><th>CourseID</th><th>CourseName</th></tr>"; while($row = mysql_fetch_array ($result)) echo mysql_error(); { echo "<tr><td>"; echo $row['StudentID']; echo "</td><td>"; echo $row['StudentName']; echo "</td><td>"; echo $row['CourseID']; echo "</td><td>"; echo $row['CourseName']; echo "</td></tr>"; } echo "</table>"; mysql_close($con); ?>
  3. i need to use the StudentID from take table
  4. hi guys how to fix this error. i have this query $sql = " SELECT take.StudentID ,student.StudentName ,take.CourseID ,course.CourseName FROM take ,student ,course WHERE take.StudentID = student.StudentID AND take.CourseID = course.CourseID AND StudentID LIKE '$_POST[sid]%' ORDER BY StudentID ASC "; $result = mysql_query($sql) or trigger_error('MySQL Error: ' . mysql_error(), E_USER_ERROR); error msg: Fatal error: MySQL Error: Column 'StudentID' in where clause is ambiguous in C:\wamp\www\dis_take.php on line 98
  5. whats wrong with query and how should i change it? could you please tell me?
  6. could anyone please check this code for me. i get the error msg like... Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\dis_study.php on line <?php $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("uni", $con); $result = mysql_query("SELECT study.StudentID,student.StudentName,study.ProgrammeName FROM study,student WHERE study.StudentID = student.StudentID AND StudentID LIKE '$_POST[sid]%' ORDER BY StudentID ASC"); echo"<br>"; echo "<center><table width=700 border=1>"; echo "<tr><th>StudentID</th><th>StudentName</th><th>ProgrammeName</th></tr>"; while($row = mysql_fetch_array ($result)) { echo "<tr><td>"; echo $row['StudentID']; echo "</td><td>"; echo $row['StudentName']; echo "</td><td>"; echo $row['ProgrammeName']; echo "</td></tr>"; } echo "</table>"; mysql_close($con); ?>
  7. could anyone provide code for me how to search data using column name. example: if i have 2 columns called NAME,ID then i select NAME or ID and enter the keyword to search. would greatly appreciate your help!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.