Re: SQL Function works in 5.0, not 4.4.1
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Re: SQL Function works in 5.0, not 4.4.1

From: Andy Hassall <andy@andyh.co.uk>
Date: Fri Dec 30 2005 - 23:43:02 CET

On 30 Dec 2005 12:27:39 -0800, byrd.48@rocketmail.com wrote:

>function User_InsertNew($UserFirstName, $UserLastName, $UserEmail,
>$UserPassword,$ActInact){
> global $dbuser, $dbuserpass, $dbserver, $db;
> $sql='INSERT INTO `Users`(`UserFirstName`, `UserLastName`,
>`UserEmail`, `UserPassword`, `ActInact`)
>VALUES("'.$UserFirstName.'","'.$UserLastName.'","'.$UserEmail.'","'.$UserPassword.'","'.$ActInact.'");';
> $connection = mysql_connect($dbserver, $dbuser, $dbuserpass) or die
>("Could not connect to server");

 mysql_error() would add more useful information to the error message.

> $catalog = mysql_select_db($db);

 Check that this succeeds, similar to the mysql_connect call.

> $result = mysql_query($sql);

 Check that this succeeds; it's most likely this is where the error is thrown,
but you're ignoring it at the moment.

> mysql_close();
>}

-- 
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Received on Tue Jan 3 03:50:41 2006