i hav a table named 01_detail and on clicking add button i want to insert data into table ..my code is like this<input type="button" name="add" value="add" onClick="<?php
mysql_query("insert into 01_detail values(03,22,'00:00:00','00:00:00')");
?>">
when i run this query in mysql prompt it works fine but it doesnt work on cliking add button..anybody can tell me y..
want to insert data into table on cliking a form button
Moderator: General Moderators
-
bugthefixer
- Forum Contributor
- Posts: 118
- Joined: Mon Mar 22, 2004 2:35 am
First of all, may i suggest you read this!! - viewtopic.php?t=21171
Secondly, the code yu have written is total nonsense. You can't run PHP using a Javascript function.
You will need to submit the page, then run the query. Remember, PHP is server side, NOT client side!
Mark
Secondly, the code yu have written is total nonsense. You can't run PHP using a Javascript function.
You will need to submit the page, then run the query. Remember, PHP is server side, NOT client side!
Mark