hi
i really new to programing
im unable to run mysql_query
can anybody check whats wrong with my code.[php]
Customer List
<?php
mysql_connect("localhost","root","");
mysql_select_db("tanisha") or die("database not found");
?>
Costomer List |
</tr>
<tr>
<td>Sr.#</td>
<td>auto</td>
</tr>
<tr>
<td>Costomer Name</td>
<td><input type="text" name="name"></td>
</tr>
<tr>
<td>Telephone 1</td>
<td><input type="number" name="phone1"></td>
</tr>
<tr>
<td>Telephone 2</td>
<td><input type="number" name="phone2"></td>
</tr>
<tr>
<td>Address</td>
<td><input type="text" name="address"></td>
</tr>
<tr>
<td>Misc</td>
<td><input type="text" name="misc"></td>
</tr>
<tr>
<td align="center" colspan="2">
<input type='submit' name='submit' value="submit">
</td>
</tr>
</table>
<?php
mysql_connect(“localhost”,“root”,"");
mysql_select_db(“tanisha”);
if (isset($_POST['submit'])){
$_name = $_POST['name'];
$_phone_1 = $_POST['phone1'];
$_phone_2 = $_POST['phone2'];
$_address = $_POST['address'];
$_misc = $_POST['misc'];
$query="INSERT INTO customers_list
(name,telephon1,telephone2,address,misc) values
('$_name','$_phone_1','$_phone_2','$_address','$_misc')";
if (mysql_query($query)){echo "New record created successfully";}
else{echo "Error:";}
//mysql_query($query) or die("database not found");
}
?>
[/php]