You are here: Re: i dont understand why this wont run « PHP Programming Language « IT news, forums, messages
Re: i dont understand why this wont run

Posted by Tim Roberts on 11/19/06 06:46

"so many sites so little time" <kkddrpg@gmail.com> wrote:
>
>the table is head the colunm is called body
>
><?php //show_site.php
>// This script retrieves blog entries from the database.
>...
>// Connect and select.
>if ($dbc = @mysql_connect ('localhost', 'username', 'password')) {
>
> if (!@mysql_select_db ('username_tpp')) {
> die ('<p>Could select the database because: <b>' . mysql_error() .
>'</b></p>');
> }
>} else {
> die ('<p>Could not connect to MySQL because: <b>' . mysql_error() .
>'</b></p>');
>}
>{
>if ($show = SELECT body from home;)

You didn't really expect that to work, did you?

$q = mysql_query("SELECT body FROM home;", $dbc);
while( $row = mysql_fetch_array($q) )
{
echo "<h3>$row</h3>\n";
}

>mysql_close(); // Close the database connection.
>?>

By the way, you can't embed an <h3> tag into a <p> tag.
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

 

Navigation:

[Reply to this 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

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