Hi all, I have this really strange problem. Apache 2.0.50, MySQL 4.1.4a,
and PHP 5.0.2.
 
I have about 7000 records in a table called mailinglist, I will show you
the sql to build the table:
 
CREATE TABLE `mailinglist` (
  `id` int(20) NOT NULL auto_increment,
  `active` char(1) NOT NULL default '1',
  `sent` char(1) NOT NULL default '0',
  `isp` varchar(2) NOT NULL default '0',
  `fname` varchar(30) NOT NULL default '',
  `lname` varchar(30) NOT NULL default '',
  `office` varchar(100) NOT NULL default '',
  `fax` varchar(30) NOT NULL default '',
  `cellular` varchar(30) NOT NULL default '',
  `type` varchar(20) NOT NULL default '',
  `office_name` varchar(100) NOT NULL default '',
  `address` varchar(255) NOT NULL default '',
  `suite` varchar(20) NOT NULL default '',
  `city` varchar(255) NOT NULL default '',
  `state` varchar(2) NOT NULL default '',
  `zip` mediumint(5) unsigned zerofill NOT NULL default '00000',
  `email` varchar(255) NOT NULL default '',
  `new_id` int(20) NOT NULL default '0',
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
 
So now that you know the details, here is the problem.
 
I search the list like so:
 
$email="[EMAIL PROTECTED]";
$query=mysqli_query($cnn,"SELECT * FROM mailinglist WHERE
email='$email'");
 
When I do:
 
Echo mysqli_num_rows($query);
 
I get 0 back, The address I am searching is in the database, I have
triple checked it with phpmyadmin.
The only way I can get it to return the record I am looking for is to do
this.
 
$email="[EMAIL PROTECTED]";
$query=mysqli_query($cnn,"SELECT * FROM mailinglist WHERE email like
'$email%'");
 
Then this finally returns 1. I have tried many different email
addresses; nothing comes back, not even from the SQL query window within
phpmyadmin v. 2.6.0-rc2
 
This has been puzzling me for hours on end. If anyone can provide any
help, that would be great
 
 
-Wendell Frohwein

Reply via email to