It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming PHP and MySQL Forum

what kind of code?

Moderator: Malcolm

what kind of code?

Postby nighthawk on Sat Sep 09, 2006 7:59 pm

1. [php] mysql_connect('localhost',$username,$password);
@mysql_select_db('Database Name');

$query = 'whatever';

$result = mysql_query($query);

mysql_close();

// et cetera et cetera [/php]

2.[php]$db=new mysqli('localhost','user','pass','database');
$query="select something from some_table";
$result=$db->query($query);

//etc[/php]

what kind of code should I use? First one is procedural, and second object orienteted, right? Which one is more up to date?
User avatar
nighthawk
250+ Club
 
Posts: 420
Joined: Sun Jun 11, 2006 1:53 pm
Location: SFRJ

Postby Nicholas O on Sat Nov 04, 2006 3:48 pm

the first one i would say...
Nicholas O
 
Posts: 6
Joined: Mon Oct 30, 2006 7:54 pm
Location: Norway


Who is online

Users browsing this forum: No registered users and 0 guests