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 |
Explain various On-Delete options in a DB table. Which is the default option?
0 Answers Akamai Technologies,
Do comments need to go in a special place in sql server 2005?
What is collation sensitivity? Explain different types.
How many jobs will create for Mirroring, Log Shipping, and Transactional Replication?
How do you know if sql server is running on your local system?
What is multilevel indexing?
Lets say due to N/W or Security issues client is not able to connect to server or vice versa. How do you troubleshoot?
Can you tell me some of the common replication dmv's and their use? : sql server replication
Well sometimes sp_reanmedb may not work you know because if some one is using the db it will not accept this command so what do you think you can do in such cases?
Characterize join and name diverse sorts of joins?
Will count(column) include columns with null values in its count?
what operator performs pattern matching?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)