Jump to content

Add columns to mysql query after being queryed


lordzardeck

Recommended Posts

Hey, i was wondering if you can take a query such as:

 

$sql="SELECT * FROM items WHERE itemid = 1";
$query = mysql_query($sql);

 

and then add a column to it with your own data like this:

 

$row = mysql_fetch_row($query);
$row[subject] = "English";

 

I want to return the $query having the new column Subject. Note, the column Subject does not exist in the table. I have tried different means, but I didn't know if it was possible.

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.