Open Source Tutorials - Open Source Training
Open source training & tutorials from experienced, passionate people
chrome icon firefox icon ie icon opera icon safari icon Sings in these Browsers
A- A A+

By A Web Design

Welcome, Guest
Username Password: Remember me

Feedback from MySQL
(1 viewing) (1) Guest
All your queries regarding
MySQL Installation,
Learning MySQL DBA,
and tonnes more... will be solved in this forum
  • Page:
  • 1
TOPIC:

Feedback from MySQL

Feedback from MySQL 1 year, 10 months ago #63

  • sami
  • OFFLINE
  • Junior Boarder
  • Posts: 24
  • Karma: 0
Hi..
How can I receive feedback from MySQL when my PHP encounters a problem?

Re:Feedback from MySQL 1 year, 9 months ago #69

  • abraham
  • OFFLINE
  • Junior Boarder
  • Posts: 25
  • Karma: 0
When you are working with PHP and MySQL and encounter an error, it is helpful to receive more detailed information regarding the problem.

You can use the mysql_error ( ) to get feedback from MySQL to your PHP document if you are encountering problems.

It is phrased as: mysql_error ( [link_identifier] ).

Hope this help you.

Re:Feedback from MySQL 1 year, 9 months ago #73

  • sami
  • OFFLINE
  • Junior Boarder
  • Posts: 24
  • Karma: 0
Thanks for the help.. but it would be very helpful if you can explain me how to utilize mysql_error()?

Re:Feedback from MySQL 1 year, 9 months ago #79

  • kate
  • OFFLINE
  • Senior Boarder
  • Posts: 47
  • Karma: 0
The following Example might help you in understanding mysql_error():

mysql_connect("your.hostaddress.com", "username", "password") or die(mysql_error())

This will return an error if there is a problem connecting to your MySQL database

$value = mysql_query($your_query) or die("A MySQL error has occurred.<br />
Your Query: " . $your_query . "<br />
Error: (" . mysql_errno() . ") " . mysql_error())

When you encounter an error, this will return your custom message (A MySQL error has occurred.<br />) followed by a line number, and the actual error.
  • Page:
  • 1
Time to create page: 2.44 seconds
OSV Newsletter


Receive HTML?

NOTE: To prevent subscription to the OSV newsletter, uncheck the checkbox above.
Guest Blog for OSV
Free Ebook Download