Similar Threads:
1.Passing multiple selections to a MySql query
Hello All,
Can someone help me with a problem I am having? I have a form which
has a multi-select list where the user can select more than one
company name from a list and I need to pass those selections to a
MySQL query for a report.
How do I get the list of items passed to my new page and include those
in my MySQL statement?
Any and all help is appreciated.
Thanks,
~John
2.selection criteria spread on multiple rows.
Hi,
I'm having the following problem. I have a table that contains
information about books people read, i.e. each row has two columns,
people id and book id.
I need to do the following query: retrieve the list of all people that
read ALL the books in a given list, e.g. all the people that read book
X and book Y and book Z.
Tu further complicate the situation, an extended query also include an
exclusion crieteria, i.e. a list of books that the user should not
have read.
I really have no clue on how to approach this.
Any help will be much appricated.
Abe.
3.List Multiple Selection to MySQL
4.php/mysql results on multiple pages script
I'm using the following script to show 10 records per page, but where the
pagecount, next & previous page links should be, I'm getting 'Pages :::'. There
are 20 records in that database that I am trying to access. Whats wrong with
the script?
<?
$host = 'xx';
$username = 'xx';
$password = 'xx';
$database = 'xx';
$conn = mysql_connect($host,$username,$password) or die("Cannot connect");
mysql_select_db($database) or die("Cannot select db");
/* Sending query to MYSQL */
$query1 = "select * from blogs";
// ==============
// Configuration
// ==============
$perpage = "10"; // How many results to show per page
$pageshow = "10"; // How many pages you want to show in the direction bar
$records = mysql_fetch_array(mysql_query($query1));
$page_num = ceil($records[results] / $perpage);
$page = ($page) ? $page : 1;
$vstart = $perpage * ($page-1);
$page_start = floor(($page-1)/ $pageshow ) * $pageshow ;
$page_end = $page_start + $pageshow;
for ($p=$page_start+1 ; ($p <= $page_end) && ($p = $page_num) ; $p++ )
{
if ($page == $p) {
$direct_bar .= "<b>$p</b> ";
} else {
$direct_bar .= "<a href='$PHP_SELF?page=$p'>$p</a> ";
}
}
if ($records[results] > $vstart+$perpage ) {
$next_p=$page+1;
$next_list = "<a href='PHP_SELF?page=$next_p'>Next >></a> \n";
}
if ($page>1) {
$prev_p=$page-1;
$prev_list="<a href='PHP_SELF?page=$prev_p'><< Prev</a>\n";
}
// Below will show the page numbers
//print >>>EOF;
print "Pages:";
print $prev_list;
print ":";
print $direct_bar;
print ":";
print $next_list;
// EOF
/* Sending query to MYSQL */
$query = "select * from blogs limit $vstart,$perpage";
$query_result = mysql_query($query) or die("<b>MySQL Error:</b> " .
mysql_error());
$num=mysql_numrows($query_result);
mysql_close();
print "<table>";
if (mysql_numrows($query_result) <> 0){
$i=0;
while ($i < $num) {
$blog_id=mysql_result($query_result,$i,"blog_id");
$day=mysql_result($query_result,$i,"day");
$month=mysql_result($query_result,$i,"month");
$year=mysql_result($query_result,$i,"year");
$title=mysql_result($query_result,$i,"title");
echo "<tr><td width='45px' valign='top'>$day $month</td><td><a
href='blog_details.php?blog_id=$blog_id'>$title</a></td></tr>";
$i++;}
}
print "</table>";
?>
<?
//EOF;
// Below will show the page numbers
//print >>>EOF
print "Pages:";
print $prev_list;
print ":";
print $direct_bar;
print ":";
print $next_list;
//EOF;
?>
5.Drop Down Lists Multiple Selections in PHP
Hi all...
How do I get the MULTIPLE results from a drop down list box form that
handles multiple?
<selection name="test" size="10">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
echo $_REQUEST["test"]; seems to only display the LAST selection that
you chose if you selected all of them.
Any thoughts?
Thanks
6. select lists (display multiple selections) - PHP
7. #RESOLVED# select lists (display multiple selections) - PHP
8. Mail values from a List with Multiple Selections with PHP