Results 1 to 10 of 10
-
02-17-2010, 12:50 AM #1
Freshman
- Join Date
- Feb 2010
- Posts
- 5
- Thanks
- 0
- Thanked 0 Times in 0 Posts
- Feedback Score
- 0
How to connect MYSQL Data base on a webserver with a PHP Script
How to connect MYSQL Data base on a webserver with a PHP Script or page?
HI,
I have a website and i want to connect a database in order to get form data saved into it.
Want to do it using PHP.
Now i am looking or the basic connection process. Not the SQL syntax for queries but only to establish the connection.
-
02-17-2010, 02:10 AM #2
Freshman
- Join Date
- Feb 2010
- Posts
- 7
- Thanks
- 0
- Thanked 0 Times in 0 Posts
- Feedback Score
- 0
Hi,
Go through this - dev.mysql.com/tech-resources/articles/ddws/21. Use html at the end of this page.
May be you can get the solution from this...
Regards,
-
03-02-2010, 09:35 PM #3
Junior
- Join Date
- Sep 2009
- Posts
- 187
- Thanks
- 0
- Thanked 1 Time in 1 Post
- Feedback Score
- 0
You can connect your table to the page you want to have a database connection by clicking the Database on the dreamweaver
but before that you must first set the necessary privileges to XAMPP. Enter the necessary fields needed and then remember the
connection name and the password because it will be ask to you to input if your gonna connect it when you click the database then
database behavior. Hope it will help you.
-
07-09-2010, 02:08 AM #4
Banned
- Join Date
- Jun 2010
- Location
- USA
- Posts
- 194
- Thanks
- 0
- Thanked 1 Time in 1 Post
- Feedback Score
- 0
MYSQL can be installed runs in any remote server user can connect to the local server using IP address on the privilege they have. Once connected users can manipulate the MySQL database by using different PHP commands. So first you learn about PHP commands.
-
07-18-2010, 07:10 PM #5
Freshman
- Join Date
- Jul 2010
- Location
- Belgium
- Posts
- 20
- Thanks
- 0
- Thanked 0 Times in 0 Posts
- Feedback Score
- 0
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
more on http://php.net/manual/en/function.mysql-connect.php
-
07-27-2010, 06:08 AM #6
Freshman
- Join Date
- Jul 2010
- Posts
- 32
- Thanks
- 0
- Thanked 1 Time in 1 Post
- Feedback Score
- 0
HI, we easily connect Server Side Scripting Language,PHP with Open Source Database System Software "MySql " ,
and here I Mention Basic code that' help you,
<?php
$connection = mysql_connect("localhost","root","");
/*
Server Name => "localhost", username => "root", Password =>" ".
$connection having Resource Data Type.
*/
if (!$connection)
{
die('We unable to Connect, Try Again !! connect: ' . mysql_error());
}
//Now before Creating Table we Must Create Data Base, then see here,
if (mysql_query("CREATE DATABASE sample_database_name",$connection))
{
echo "Your Database created, Successfully";
}
else
{
echo "Error, During creating database: " . mysql_error();
}
/*
After Creating Database We need to create Table.
*/
mysql_select_db("sample_database_name", $connection);
$sql = "CREATE TABLE sample_table_name
(
UserName varchar(15) NOT NULL,
Address varchar(15) NOT NULL,
)";
// Execute query
mysql_query($sql,$connection);
/*
After completion of task we need to close connection.
*/
mysql_close($con);
?>
and still if you Problem then Just mention here, I'll Try to Solve them.
-
08-18-2010, 06:39 AM #7
Junior
- Join Date
- Dec 2009
- Posts
- 234
- Thanks
- 0
- Thanked 2 Times in 2 Posts
- Feedback Score
- 0
The query is used to connect with the mysql
mysql_connect(servername, username, password);
-
08-22-2010, 10:51 AM #8
Sophomore
- Join Date
- Jul 2010
- Location
- Pakistan
- Posts
- 130
- Thanks
- 6
- Thanked 1 Time in 1 Post
- Feedback Score
- 0
really good question kindly take a look at following tutorials, through these tutorial u will get exactly what u want
http://www.w3schools.com/php/php_mysql_connect.asp
-
08-22-2010, 12:48 PM #9
Freshman
- Join Date
- Aug 2010
- Posts
- 19
- Thanks
- 0
- Thanked 0 Times in 0 Posts
- Feedback Score
- 0
Learning how to connect to a MySQL database with PHP shouldn't be a difficult task.
//Connect to MySQL
$res = mysql_connect("host","username","password");
//Select database
mysql_select_db("DatabaseName");
-
09-04-2010, 12:39 PM #10
w3school is best answer to your question look at w3school website..
Similar Threads
-
How best ot optimize content?
By wujijiangjun in forum Search Engine OptimizationReplies: 13Last Post: 10-27-2011, 08:21 AM -
Selling PHP Matrimonial Script (shaadi.com clone) at www.infocuswebdesigning.com
By ashish10 in forum WebsitesReplies: 3Last Post: 08-13-2011, 06:19 PM -
MySQL Best Practices
By eusha in forum DatabasesReplies: 5Last Post: 12-11-2009, 03:42 AM -
Matrimonial Website For Sell, Also Scripts Available (shaadi.com clone) @ www.infocuswebdesigning.com
By ashish10 in forum WebsitesReplies: 1Last Post: 07-06-2009, 10:35 PM -
Complete Matrimonial Script @ www.infocuswebdesigning.com
By ashish10 in forum Marketplace - Buy, Sell & TradeReplies: 0Last Post: 06-13-2009, 07:18 AM



Reply With Quote

