bo select a
Posted: Thu Jan 08, 2004 8:39 am
Help! Below code should select at least 1200 rows. But my echo statement display the figure 0. Where am i going wrong? Using the latest version of PHP and MYSQL.
cheers,
lee.
[Edit: Added PHP tags for eyecandy. --JAM]
cheers,
lee.
Code: Select all
<?php
Connectlistmail();
$sql = "SELECT user1 FROM lm_users WHERE user2 IN ('BB%', 'BL%', 'CA%', 'CH%', 'CW%', 'FY%', 'L1%', 'L2%', 'L3%', 'L4%', 'L5%', 'L6%', 'L7%', 'L8%', 'L9%', 'LA%', 'LL%', 'M1%', 'M2%', 'M3%', 'M4%', 'M5%', 'M6%', 'M7%', 'M8%', 'M9%', 'OL%', 'PR%', 'WA%', 'WN%') ";
$result = mysql_query($sql) or die(mysql_error().'<p>'.$sql.'</p>');
$total = mysql_num_rows($result);
echo $total;
?>
// OR
<?php
Connectlistmail();
$sql = "SELECT user1 FROM lm_users WHERE user2 IN ('BB', 'BL', 'CA', 'CH', 'CW', 'FY', 'L1', 'L2', 'L3', 'L4', 'L5', 'L6', 'L7', 'L8', 'L9', 'LA', 'LL', 'M1', 'M2', 'M3', 'M4', 'M5', 'M6', 'M7', 'M8', 'M9', 'OL', 'PR', 'WA', 'WN') ";
$result = mysql_query($sql) or die(mysql_error().'<p>'.$sql.'</p>');
$total = mysql_num_rows($result);
echo $total;
?>