Jump to content

column names not responding only numbers?


SmileyWar

Recommended Posts

Hello all,

 

This is a odd one, last year i built a query where i was pretty new to mysql, and what i did was as simple as this.

 

Get the query and then print the data. But now that i'm updating the database i absolutely hate having to use numbers because i want to reorder the table. But when i want to change it to column names it's not getting the data. And i can't understand why that's happening.

 

Here is what i have.

 


        $op1 = mysql_query("SELECT * FROM carchain_prices_qty WHERE ProductID='".$option1."' ", $connect)
or die(mysql_error());
$product1 = mysql_fetch_row($op1);


if ($options >= "1"){
			echo'            
				<li class="ui-tabs-nav-item ui-tabs-selected" id="nav-fragment-1"><a href="#fragment-1">
				<center>
				<img src="images/preview_'.$product1[8].'_small.jpg" alt="'.$product1[1].'" title="'.$product1[1].'" />
				</center>
				<span>
				£ '.$product1[2].' per pair<br> '.$product1[9].'<br>'.$product1[10].'
				</span>
				</a></li>
			';
		}

 

and here is what i want it to be, noting that all my newly designed scripts are always with column names, it's only that first one i built due to the same issue i have now i used numbers in the array rather then names

 

if ($options >= "1"){
			echo'            
				<li class="ui-tabs-nav-item ui-tabs-selected" id="nav-fragment-1"><a href="#fragment-1">
				<center>
				<img src="images/preview_'.$product1['PageID'].'_small.jpg" alt="'.$product1['ProductID'].'" title="'.$product1['ProductID'].'" />
				</center>
				<span>
				£ '.$product1['Price'].' per pair<br> '.$product1['ProductBrand'].'<br>'.$product1['ProductName'].'
				</span>
				</a></li>
			';
		}

 

Your wisdom is much appreciated, thanks!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.