how we can use a database with php.

Answers were Sorted based on User's Feedback



how we can use a database with php...

Answer / narayana

no idea because its a seperate software

Is This Answer Correct ?    1 Yes 1 No

how we can use a database with php...

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

Post New Answer

More SQL Server Interview Questions

Explain ranking functions?

0 Answers  


can you any body tell me while running BCP Out in instance in sql server 2000 is getting error. Error = [Microsoft][ODBC SQL Server Driver][DBNETLIB]SQL Server does not exist or access denied.?

1 Answers  


you added a row to a view, but the row is not shown on the view. Explain how this can happen, and how you can remedy the situation

0 Answers  


What is a DBMS, query, SQL?

0 Answers   Maveric,


Name three of the features managed by the surface area configuration tool? : sql server security

0 Answers  






Define Foreign Key?

3 Answers   ADP, College School Exams Tests,


i need some interview questions on sql server developer plz any onee send some links.

2 Answers  


How do I make a resultset scrollable?

0 Answers  


How can you check the version of sql server?

0 Answers  


How would we use distinct statement? What is its use?

0 Answers  


Define clusters?

0 Answers  


1.How to check the backup file details if we do not have access to that folder 2.how to check the backup file size without connecting to the folder

3 Answers   CarrizalSoft Technologies, IBM,


Categories