Jump to content

Having a brain block - adding numbers from database


herghost

Recommended Posts

Hi all,

 

for some reason I cant see this blantantly obvious query.

 

I have 3 rows in my database, all with an id of 1, their is a column called price which contains three different float values, how the hell do I write a query in php for this?!

$q = mysql_query("SELECT price FROM mytable WHERE id=1")
????

Thanks!

First of all, you're not writing a query in PHP, you're writing it in SQL.  New programmers don't usually understand that they're using up to 5 languages at once.  PHP, SQL, JavaScript, HTML, and Regular Expressions are all stand-alone languages.

 

Secondly, bah, pikachu beat me.

 

-Dan

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.