Jump to content

[SOLVED] array of errors


web_master

Recommended Posts

hi,

 

I have a 12 (if) errors. How can I do to put posted variables in dbase only if all the error are 0?

 

<?php
if( $_POST['something'] ) { $error[1] == 1; } else { $error[1] == 0; }

if( $_POST['something2'] ) { $error[2] == 1; } else { $error[2] == 0; }

if( $_POST['something3'] ) { $error[3] == 1; } else { $error[3] == 0; }


if(all the errors are equal zero) {
$query = mysql_query("INSERT INTO `table` ( ...
}
?>

Link to comment
https://forums.phpfreaks.com/topic/113679-solved-array-of-errors/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.