Reply to Help learning php/mysql

Your name:

Reply:


Posted by josh on 04/12/07 05:01

I've been trying to learn some simple mysql and php commands by
replicating an html outline of my monthly bills using a mysql database
and php. Can anyone make suggestions about what I've done and what I
should do to complete this example? I would like to complete this and
know how others would do it since I'm sure there are much better ways.
To complete this, I just want to break up the results by months and
then do some math with the ones that are unpaid.

Thanks for any help. --Josh

Here is what I want it to look like:
http://www.brainbros.com/billspub.php

Here is the working page so far:
http://www.brainbros.com/select.php

Here is the basic code that created the above output of "select.php":

$query = "SELECT * FROM bills ORDER BY date_due DESC";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_array($result)){

if ($row['paid'] == "yes")

echo "<tr bgcolor='green'><td>".$row['name']."</td>".
"<td>$".$row['amount']."</td>".
"<td>".$row['date_due']."</td>".
"<td><div align='center'>".$row['paid']."</div></td>".
"<td>".$row['date_paid']."</td>".
"<td>".$row['account']."</td>".
"<td>".$row['date_bill']."</td></tr>";

else
echo "<tr bgcolor='red'><td>".$row['name']."</td>".
"<td>$".$row['amount']."</td>".
"<td>".$row['date_due']."</td>".
"<td><div align='center'>".$row['paid']."</div></td>".
"<td>".$row['date_paid']."</td>".
"<td>".$row['account']."</td>".
"<td>".$row['date_bill']."</td></tr>";

}
?>

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация