how we can use a database with php.
Answers were Sorted based on User's Feedback
Answer / shrikant
mysql> CREATE DATABASE first_test;
Query OK, 1 row affected (0.31 sec)
mysql> USE first_test;
Database changed
mysql> CREATE TABLE people (
id int UNIQUE NOT NULL,
first_name varchar(40),
surname varchar(50),
PRIMARY KEY(id)
);
Query OK, 0 rows affected (0.24 sec)
mysql> INSERT INTO people VALUES(1,'Ann','Brache');
Query OK, 1 row affected (0.09 sec)
mysql> INSERT INTO people VALUES(2,'Narcizo','Levy');
Query OK, 1 row affected (0.02 sec)
mysql> INSERT INTO people VALUES(3,'Tony','Crocker');
Query OK, 1 row affected (0.00 sec)
Your table should now look as follows:
mysql> SELECT * FROM people;
+----+------------+---------+
| id | first_name | surname |
+----+------------+---------+
| 1 | Ann | Brache |
| 2 | Narcizo | Levy |
| 3 | Tony | Crocker |
+----+------------+---------+
and for connecting
<?php
$username = "username";
$password = "password";
$hostname = "localhost";
$dbh = mysql_connect($hostname, $username, $password)
or die("Unable to connect to MySQL");
Is This Answer Correct ? | 0 Yes | 0 No |
What are subqueries in sql server?
Explain how long are locks retained within the repeatable_read and serializable isolation levels, during a read operation with row-level locking?
what is the query and condition to delete datas in sql server.
what is bit datatype? : Sql server database administration
Explain in brief about Microsoft SQL server?
How to change the ownership of a schema in ms sql server?
What are the differences between local and global temporary tables?
About DTS usage ?
Tell me what is difference between view and materialized view?
Explain indexed view?
What is difference statement and preparedstatement?
What is a field in a table?