Jump to content

Query code advice


gwh

Recommended Posts

Hi everyone,

 

I have the following code that selects two columns from my 'shirts' table but only where the shirtID is equal to the variable $itemID.

 

$itemID = 4;  

mysql_select_db($database_localhost, $localhost);
$query_rsShirts = "SELECT shirtDescLadies, shirtDescMen FROM shirts WHERE shirtID IS '$itemID";
$rsShirts = mysql_query($query_rsShirts, $localhost) or die(mysql_error());
$row_rsShirts = mysql_fetch_assoc($rsShirts);
$totalRows_rsShirts = mysql_num_rows($rsShirts);

 

In addition to this selection from my shirts table, I need the record set to select other columns also within the same table but I'm not sure how to add to the query code. I need to also select the following columns:

 

shirtTitle

shirtSKU

shirtPrice

shirtColours

shirtSizes

shirtImage

 

Would I need to create a separate recordset or can someone tell me how to extend the code to encompass these other columns?

 

Appreciate any advice.

Link to comment
https://forums.phpfreaks.com/topic/184158-query-code-advice/
Share on other sites

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.