tags:

views:

33

answers:

2

This will probably sound pretty dumb. I've got a mysql function containing the following...

@mysql_connect()

@mysql_select_db($databaseName,$link);

mysql_query($sql,$link);

mysql_error()

mysql_fetch_array($result,MYSQL_ASSOC)

mysql_num_rows($result)



Can I just bung an i after mysql like this...


@mysqli_connect

mysqli_query($link, $sql);

mysqli_error($link)."]";

mysqli_fetch_array($result,MYSQLI_ASSOC))

mysqli_num_rows($result);

The first two I know are ok but what about the others? I'm not sure those functions actually exist as straight swap mysqli versions. Can't seem to find much info about them.

What would there mysqli equivilent be?

Can I just use mysqli_connect and mysqli_query but use the old mysql functions for the others? Do they work together like that

A: 

Here is the "book" area of the PHP manual showing you EVERY mysqli function available. Your assumption is pretty much correct, a lot of the naming convention applies with just adding 'i' but to be sure that it exists, take a peak here: http://php.net/manual/en/book.mysqli.php

Paul Dragoonis
A: 

One of the strengths of the MySQLi extension is it's more object oriented. I'd recommend moving to that method as it's easier to work with.

Pickle