Welcome! Log In Create A New Profile

Advanced

mysql_error parameters ?

Posted by 35316462_Antondev 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
mysql_error parameters ?
April 30, 2013 04:17PM
Hi. I am unable to find a solution for the following:

Language: PHP
$results = mysql_query($update) or die(mysql_error());

I know the error will display if there is any, but I want to pass my own custom string value as a parameter in the mysql_error() function so if a error occurs I will have my own custom string value + MySQL generated error message.

I want to be more descriptive in what exactly went wrong for debugging.

How do you pass that string value parameter ?

Student Number: 78042879 (Part Time Courses)
avatar Re: mysql_error parameters ?
April 30, 2013 07:10PM
Try

Language: PHP
or die("put some message in here" .mysql_error())

____________________________________________Nazi Coder____________________________________________

I'm not antisocial, I'm just not user friendly

"It's not a bug; it's an undocumented feature!" ~ some unknown Microsoft developer
Re: mysql_error parameters ?
May 01, 2013 12:18PM
Hi!

That makes sense to concatenate the string with the mysql_error() function.

Will give it a go. Thank you.

Student Number: 78042879 (Part Time Courses)
Sorry, only registered users may post in this forum.

Click here to login