Re: SQL Function works in 5.0, not 4.4.1
- From: Andy Hassall <andy@xxxxxxxxxxx>
- Date: Fri, 30 Dec 2005 22:43:02 +0000
On 30 Dec 2005 12:27:39 -0800, byrd.48@xxxxxxxxxxxxxx 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@xxxxxxxxxxx :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
.
- References:
- SQL Function works in 5.0, not 4.4.1
- From: byrd . 48
- SQL Function works in 5.0, not 4.4.1
- Prev by Date: Re: SQL Function works in 5.0, not 4.4.1
- Next by Date: Re: How to tell if Mime type matches contents
- Previous by thread: Re: SQL Function works in 5.0, not 4.4.1
- Next by thread: fopen() question
- Index(es):
Relevant Pages
|