View Single Post
  #10 (permalink)  
Old 12-04-07, 03:59 PM
robertark's Avatar
robertark robertark is offline
Newbie Coder
 
Join Date: Dec 2007
Location: Springfield, MO
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Sparky222B View Post
They all exist and are non-null. Query is
Code:
$query = mysql_query("SELECT Title FROM offers WHERE country LIKE '$ucountryid' ORDER BY offerid DESC");
Nico: No SQL error is given; the query executes successfully, just doesn't return right.

Table creation structure:
Code:
CREATE TABLE `offers` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `date` varchar(255) NOT NULL default '',
  `Title` varchar(255) NOT NULL default '',
  `URL` varchar(255) NOT NULL default '',
  `Country` varchar(200) NOT NULL default '',
  `Description` varchar(255) NOT NULL default '',
  `price` varchar(255) NOT NULL default '',
  `offerid` text,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=90 ;
Try this:

PHP Code:

$query mysql_query("SELECT * FROM offers WHERE country LIKE '$ucountryid' ORDER BY offerid DESC") or die(mysql_error());
while(
$row mysql_fetch_assoc($query)) {
  
print_r($row);

Then from there, you could do something like:

PHP Code:

$query mysql_query("SELECT * FROM offers WHERE country LIKE '$ucountryid' ORDER BY offerid DESC") or die(mysql_error());
while(
$row mysql_fetch_assoc($query)) {
  
$date $row['date'];
  
$Title $row['Title'];
  
$URL $row['URL'];
  
$Country $row['Country'];
  
$Description $row['Description'];
  
$price $row['price'];
  
$offerId $row['offerid'];

  
# Echo accordingly...

Is this what you're trying to do?
__________________
Knowledge Is Power And Without Power, You're Nobody. -Self

Last edited by robertark; 12-04-07 at 04:01 PM. Reason: SELECT * FROM offers
Reply With Quote