Jump to content

How i create /control array in PHP


immunity

Recommended Posts

Hello i would like someone to help me on PHP arrayI have on my page 6 get names ( $_GET['1'] , $_GET['2'] ...)i want to put them on an arrayi have a strin $string = "Select * from account ";then create a loop for how many array for ( ){ if ( i ==0){ $string = $string."Where ";}$string = $string.$array ;}how i say array in php ?

Link to comment
Share on other sites

It looks like you want the you/user to enter SQL code into the address bar. Just remember the user would be able to do whatever they wanted with your database.Use mysql_real_escape_string().You might want something like for ($i=0; $i<count($array); $i++) { // execute code;}Instead of allowing the user to control the code, create your own inside the array, and check for a value inside of the array with in_array().$array=array("user='$user'", "pattern LIKE '%people%'");

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...