Reply to Re: SQL Function works in 5.0, not 4.4.1

Your name:

Reply:


Posted by Andy Hassall on 12/31/05 00:43

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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация