PC Nerd Posted August 8, 2008 Share Posted August 8, 2008 Hi, Im writing a cron that maintains data between databases. Im working with a "CREATE IF NOT EXCISTS 'users' (~~~)" statement - but i want my cron to return a value depending on whether the SQL creates the table or not - ie like a log. my output log would give me information such as: "Creating Users Updating User Data" How can i get mysqli ( or MySQL?) to return values based on this? thanks Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted August 8, 2008 Share Posted August 8, 2008 By checking to see if any rows was affected by the query, you can check this by using the mysql_affected_rows or mysqli->affected_rows functions. Quote Link to comment Share on other sites More sharing options...
PC Nerd Posted August 8, 2008 Author Share Posted August 8, 2008 * so affected_rows will show what if it has created a table ( because otherwise it stores the number of rows created/updated etc.... what abotu tables)? Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.