Re: SQL Function works in 5.0, not 4.4.1



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
.



Relevant Pages

  • Re: Can somebody give me an example how to obtain a files size?
    ... >> or even a more informative error message. ... then it will fail at the most ... Nearly;-) If stat() returns anything non-zero the condition is true ... But if it succeeds it returns ...
    (comp.programming)
  • Re: regsvr32 cmdlib.wsc
    ... The error message says: The app or DLL ... and it succeeds, popping up a message box that says: ... DLLRegisterServerEx: C:\WINDOWS\System32\scrobj.dll succeeded. ...
    (microsoft.public.windowsxp.embedded)
  • "501 5.5.4 Invalid Address" error message
    ... "501 5.5.4 Invalid Address" error message. ... I have an ASP application that send emails to users on a network. ... Most of the time it succeeds but on the odd occasion it get the error ...
    (microsoft.public.dotnet.general)
  • Re: took lightning hit - server 2003 bootup errors
    ... knowledge cannot reply with useful information. ... comprehensive hardware disgnostic on hard drive, CD-Rom, and web ... Unlikely that a surge caused that error message. ... Destructive surges occur once every seven or so years. ...
    (microsoft.public.windows.server.setup)
  • Re: Parsing a text file.....
    ... > It is better to put the filename in the error message. ... > useful information. ... is worthless information if the user mistypes the name of a file. ... tailor the message to the expected audience. ...
    (comp.lang.perl.misc)