okeddy
11-14-2010, 02:56 PM
I have a db page and when you leave the page to post selections on return you come back to the same id row you selected beacause I have this code on the select.php page (thx to Mattf and others)
$back = isset($_GET['id']) ? '#' .intval($_GET ['id']) : '';
header( 'Location: indexfull2.php'.$back );
This is fine if the user hasn't input any search parameters, if they have made a search for 'beatles' they would return to the page at the id row they had selected but it would be within the entire database page rather than the search beatles page with 20 or so rows.
So is there away to save the search parameters on exit from the db page and re select them on the way back, rather than selecting the entire db it normally does.
The code
$var = @$_GET['a'] ;
$search1 = ($var);
$var = @$_GET['b'] ;
$search2 = ($var);
$var = @$_GET['c'] ;
$search3 = ($var);
$var = @$_GET['d'] ;
$search4 = ($var);
$var = @$_GET['e'] ;
$search5 = ($var);
$var = @$_GET['f'] ;
$search6 = ($var);
$var = @$_GET['g'] ;
$search7 = ($var);
mysql_connect("localhost","root","");
mysql_select_db("a2149809_MV") or die ("Unable to select database");
$query = "SELECT * FROM `music vidz` WHERE `Artist` LIKE \"%$search1%\"
AND `Title` LIKE \"%$search2%\" AND `Disc` LIKE \"%$search3%\"
AND `Era` LIKE \"%$search4%\" AND `Date Added` LIKE \"%$search5%\"
AND `AR` LIKE \"%$search6%\" AND `Quality` LIKE \"%$search7%\" order by `Artist`";
$result=mysql_query($query);
$num=mysql_num_rows($result);
mysql_close();
$back = isset($_GET['id']) ? '#' .intval($_GET ['id']) : '';
header( 'Location: indexfull2.php'.$back );
This is fine if the user hasn't input any search parameters, if they have made a search for 'beatles' they would return to the page at the id row they had selected but it would be within the entire database page rather than the search beatles page with 20 or so rows.
So is there away to save the search parameters on exit from the db page and re select them on the way back, rather than selecting the entire db it normally does.
The code
$var = @$_GET['a'] ;
$search1 = ($var);
$var = @$_GET['b'] ;
$search2 = ($var);
$var = @$_GET['c'] ;
$search3 = ($var);
$var = @$_GET['d'] ;
$search4 = ($var);
$var = @$_GET['e'] ;
$search5 = ($var);
$var = @$_GET['f'] ;
$search6 = ($var);
$var = @$_GET['g'] ;
$search7 = ($var);
mysql_connect("localhost","root","");
mysql_select_db("a2149809_MV") or die ("Unable to select database");
$query = "SELECT * FROM `music vidz` WHERE `Artist` LIKE \"%$search1%\"
AND `Title` LIKE \"%$search2%\" AND `Disc` LIKE \"%$search3%\"
AND `Era` LIKE \"%$search4%\" AND `Date Added` LIKE \"%$search5%\"
AND `AR` LIKE \"%$search6%\" AND `Quality` LIKE \"%$search7%\" order by `Artist`";
$result=mysql_query($query);
$num=mysql_num_rows($result);
mysql_close();