I've never really had to use arrays in my previous scripts so I can't figure this one out.
The way I made this script is also bad I think, totally not what I wanted to make it but previous tests all failed. :sleep: (learning PHP still)
<?php
/* these should be the only values that should exist in the selected table. */
$GOODVALUE = array(
"11",
"12",
"14",
"21",
"22",
"23",
"24",
"31",
"32",
"150"
);
/*
now this is the query, it would select data from Table that have values in GOODVALUE array.
i know this isn't the proper way to use array but I've never really used arrays before.
*/
$test = mysql_query("SELECT * FROM MyDB.Table WHERE ID='$GOODVALUE'");
mysql_query($test);
if(!$test){
echo "something is wrong <br />";
}
else{
echo "everything is ok<br />";
}
?>
I want the query to return an error even if there are normal data with selected values but also some data with totally random values for ID column.
I hope this explanation is good enough, please ask if you didn't understand some point.


Sign In
Create Account


Back to top









