PHP Classes

I have a piece of code that i am using for database connectio...

Recommend this page to a friend!

      MySQL connection and query  >  All threads  >  I have a piece of code that i am...  >  (Un) Subscribe thread alerts  
Subject:I have a piece of code that i am...
Summary:Package rating comment
Messages:2
Author:varghese v s
Date:2010-05-25 11:31:30
Update:2010-06-14 09:16:30
 

 

varghese v s rated this package as follows:

Utility: Not sure
Consistency: Not sure

  1. I have a piece of code that i am...   Reply   Report abuse  
Picture of varghese v s varghese v s - 2010-05-25 11:31:30
I have a piece of code that i am using for database connection (MySQL)

<?php

$dbusername="root";
$dbpassword="";
$dbname="mydb";

$link = mysql_connect('localhost', 'root', '');
if (!$link)
{
die('Could not connect: ' . mysql_error());
}

$db_selected =mysql_select_db('$dbname');

if (!$db_selected)
{
die('Could not select database: ' . mysql_error());
}



?>

  2. Re: I have a piece of code that i am...   Reply   Report abuse  
Picture of Hansen Wong Hansen Wong - 2010-06-14 09:16:30 - In reply to message 1 from varghese v s
I that is procedural coding.