0

i want to execute a sql at php which does something like changing a text column into int column.

however, this sql failed to fun at php and succeeds in my mysql admin tool (sqlyog). server responses "1 row(s) affected. 1 warning(s)". but "SHOW WARNINGS" didn't pop up anything and not surprisingly, php's mysql_error() didn't return anything.

thanks.

1 Answer 1

1

The best is to use the mysqli extension instead of the old mysql extension, as mysqli supports all of MySQL's features and offers the mysqli_get_Warnings() function. Without mysqli you can do mysql_query("SHOW WARNINGS"); (see SHOW WARNINGS docs) and then read the warnings from the result set.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.