[CODE=php] <?php //get the variables $var = $_POST['query'] ; $trimmed = trim($var); $table = $_POST['table']; //make connection $conn = mysql_connect('localhost','root','123') or die("Error:".mysql_error()); mysql_select_db('sutilities',$conn) or die("Error:".mysql_error()); //delete temp search table $del_table = "drop table search"; #mysql_query($del_table) or die ("Error:".mysql_error()); // Create a MySQL table in the selected database #mysql_query("CREATE TABLE search( #id INT NOT NULL AUTO_INCREMENT, ##PRIMARY KEY(id), # table_queried VARCHAR(30), # trimmed varchar(200))") # or die(mysql_error()); mysql_query("insert into search (table_queried, trimmed) values ('$table','$trimmed')") or die ("Error:".mysql_error()); // find out how many rows are in the table $query = "SELECT COUNT(*) FROM $table"; $result = mysql_query($query, $conn) or die("Error:".mysql_error()); $r = …

Member Avatar
Member Avatar
+0 forum 6

The End.