Hi I am New to PHP and my question looks stupid but i am stuck
I want to search operation register to search by id and print out put of perticular id
my first file has this code:

<form  action="printotreport2.php" method="POST" target="_blank">
<tr>
<td>Ot Reg ID of Patient </td>
<td>
<input type="text" name="otid" id="otid" size='15' class="select_class2"   >
<td colspan="2" align="center"> <input type="submit" name="stat_submit" value="Submit" class="but_class2" /> </td>
</tr>
</form>

Second file code

$db_host = "localhost";$db_user = "user";$db_pass = "pwd";$db_name = "obgyn_db";$db_table = "masterot";
mysql_connect("localhost", "obgyn_user", "pwd");
``
$id = $_POST['otid'];
$q1 = mysql_query("select * from masterot where id like'$id'");

but i think error in last line its not taking value
Pl help
Regards
Dr Damle

Just to be sure, you didn't forget about mysql_fetch_assoc right?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.