Custom Search

News World

Jun 4, 2011

PHP > Insert Query

1 < ? php
2 function add_user($id, $pass, $name, $email) {
3 $result=mysql_query("insert into users values
4 ('$id',ENCRYPT('$pass'),'$name','$email',NULL)");
5 if($result) {
6 echo "Row inserted
";
7 } else {
8 echo mysql_error()."
";
9 }
10 }
11 mysql_connect('localhost');
12 mysql_select_db('foo');
13 add_user('mesakh','sober','Web Solusi','web.solusi@gmail.com');
14 add_user('abetnego','weber','Web Media','e_webmedia@yahoo.com');
15 ? >

Output:
Row insertedRow inserted

No comments:

IT Conversations

Moneycontrol Latest News

Latest new pages on Computer Hope

Latest from Infoworld

Door Lock

Door Lock Import Top Door Lock from China Contact Quality Manufacturers Now