php and mysql, plzzz help me out..im running out of time |
php and mysql, plzzz help me out..im running out of time |
sanjay akella |
Jul 16 2011, 05:27 AM
Post
#1
|
Group: Members Posts: 3 Joined: 9-July 11 Member No.: 14,905 |
ive been working on registration page,with the help of html,php,mysql(wamp server) for over a day but cudnt figure it out..
please pull me out of this situation...im posting my code ova here.. im juz posting a small example over here(not the original one which i was working on) test.html <html> <body> <form action="new.php" method="post"> name:<input name="name" type="text" size="20" maxlength="10"> address:<input name="address" type="text" size="20" maxlength="10"> <input name="submit" type="submit" /> </form> </body> </html> new.php <?php $dbhost = 'localhost'; $dbuser = 'root'; $dbpass = ''; $db = 'test'; $sql = "SELECT * FROM `testing_table` LIMIT 0, 30 "; $conn = mysql_connect($dbhost,$dbuser,$dbpass); mysql_select_db = ($db); $name=$_POST['name']; $address=$_POST['address']; $query="insert into testing_table('id','name','address') values(NULL,'$name','$address')"; $result=mysql_query($query); echo $sql; ?> here is the picture of structure of mysql table |
Mahdi Eftekhari |
Feb 20 2012, 08:22 PM
Post
#2
|
Group: Members Posts: 3 Joined: 17-February 12 Member No.: 16,506 |
could not figure out what!? What is the problem? Are you getting error message? If yes what is the message?
You need to give more details of what you want to achieve. Based on lack of details and your code I am guessing you are not getting your result back. In your new.php code at the end after CODE $result=mysql_query($query); you need to extract the result first. something like thisCODE $resultSet = mysql_fetch_array($result) and then go through the array. if this was not your problem give more detail. Thanks Mahdi Eftekhari |
Lo-Fi Version | Time is now: 28th March 2024 - 07:20 PM |