473,387 Members | 1,520 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

i dont understand why this wont run

the table is head the colunm is called body

<?php //show_site.php
// This script retrieves blog entries from the database.

// Address error handing.
ini_set ('display_errors', 1);
error_reporting (E_ALL & ~E_NOTICE);

// 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;)

print "<p><h3>{$show}</h3>
</p><hr />\n";
}

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

Nov 19 '06 #1
19 2218
to see a test of this go to www.kirewire.com/ttp/index.php

so many sites so little time wrote:
the table is head the colunm is called body

<?php //show_site.php
// This script retrieves blog entries from the database.

// Address error handing.
ini_set ('display_errors', 1);
error_reporting (E_ALL & ~E_NOTICE);

// 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;)

print "<p><h3>{$show}</h3>
</p><hr />\n";
}

mysql_close(); // Close the database connection.
?>
Nov 19 '06 #2
so many sites so little time wrote:
the table is head the colunm is called body

<?php //show_site.php
// This script retrieves blog entries from the database.

// Address error handing.
ini_set ('display_errors', 1);
error_reporting (E_ALL & ~E_NOTICE);

// 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;)

print "<p><h3>{$show}</h3>
</p><hr />\n";
}

mysql_close(); // Close the database connection.
?>
Possibly because you never queried the database?

Also, the line:

if ($show = SELECT body from home;)

is not valid syntax.

And if you want to see the error messages, you need to also remove the
'@' from the mysql calls.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Nov 19 '06 #3
so many sites so little time wrote:
to see a test of this go to www.kirewire.com/ttp/index.php

so many sites so little time wrote:
>>the table is head the colunm is called body

<?php //show_site.php
// This script retrieves blog entries from the database.

// Address error handing.
ini_set ('display_errors', 1);
error_reporting (E_ALL & ~E_NOTICE);

// 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;)

print "<p><h3>{$show}</h3>
</p><hr />\n";
}

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

Not Found
The requested URL /ttp/index.php was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use
an ErrorDocument to handle the request.
Apache/1.3.37 Server at www.kirewire.com Port 80

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Nov 19 '06 #4
woops sorry its /tpp why isnt it valid syntax :( pay so much for books
that lie ;_;
Jerry Stuckle wrote:
so many sites so little time wrote:
to see a test of this go to www.kirewire.com/ttp/index.php

so many sites so little time wrote:
>the table is head the colunm is called body

<?php //show_site.php
// This script retrieves blog entries from the database.

// Address error handing.
ini_set ('display_errors', 1);
error_reporting (E_ALL & ~E_NOTICE);

// 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;)

print "<p><h3>{$show}</h3>
</p><hr />\n";
}

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

Not Found
The requested URL /ttp/index.php was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use
an ErrorDocument to handle the request.
Apache/1.3.37 Server at www.kirewire.com Port 80

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Nov 19 '06 #5
im really stuck what would work in this case all im trying to do with
that $show is to query the data base to select from table home the info
in column body and print it to the screen
so many sites so little time wrote:
woops sorry its /tpp why isnt it valid syntax :( pay so much for books
that lie ;_;
Jerry Stuckle wrote:
so many sites so little time wrote:
to see a test of this go to www.kirewire.com/ttp/index.php
>
so many sites so little time wrote:
>
>>the table is head the colunm is called body
>>
>><?php //show_site.php
>>// This script retrieves blog entries from the database.
>>
>>// Address error handing.
>>ini_set ('display_errors', 1);
>>error_reporting (E_ALL & ~E_NOTICE);
>>
>>// 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;)
>>
>> print "<p><h3>{$show}</h3>
>> </p><hr />\n";
>> }
>>
>>mysql_close(); // Close the database connection.
>>?>
>
>
Not Found
The requested URL /ttp/index.php was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use
an ErrorDocument to handle the request.
Apache/1.3.37 Server at www.kirewire.com Port 80

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Nov 19 '06 #6
i tried to fix it getting
Parse error: syntax error, unexpected T_STRING in
/home/kirewire/public_html/pp2/index.php on line 222

for

....ini_set ('display_errors', 1);
error_reporting (E_ALL & ~E_NOTICE);

// Connect and select.
if ($dbc = mysql_connect ('localhost', 'kirewire', 'erikwire')) {

if (!mysql_select_db ('kirewire_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>');
$query = SELECT body from home;

print "<p><h3>{$$query}</h3>
</p><hr />\n";
}

mysql_close(); // Close the database connection.
?>
so many sites so little time wrote:
im really stuck what would work in this case all im trying to do with
that $show is to query the data base to select from table home the info
in column body and print it to the screen
so many sites so little time wrote:
woops sorry its /tpp why isnt it valid syntax :( pay so much for books
that lie ;_;
Jerry Stuckle wrote:
so many sites so little time wrote:
to see a test of this go to www.kirewire.com/ttp/index.php

so many sites so little time wrote:

>the table is head the colunm is called body
>
><?php //show_site.php
>// This script retrieves blog entries from the database.
>
>// Address error handing.
>ini_set ('display_errors', 1);
>error_reporting (E_ALL & ~E_NOTICE);
>
>// 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;)
>
> print "<p><h3>{$show}</h3>
> </p><hr />\n";
> }
>
>mysql_close(); // Close the database connection.
>?>


>
Not Found
The requested URL /ttp/index.php was not found on this server.
>
Additionally, a 404 Not Found error was encountered while trying to use
an ErrorDocument to handle the request.
Apache/1.3.37 Server at www.kirewire.com Port 80
>
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Nov 19 '06 #7
alright so this is where im at, i did this and now it says it works but
jerry knows that i resolved my problem earlier with
www.kirewire.com/tpp2/update_site.php now i just fixed the problem with
kirewire.com/tpp2/index.php but nothing shows up on the index site but
i get no errors on the index site it looks like this

if ($dbc = mysql_connect ('localhost', 'kirewire', 'erikwire')) {

if (!mysql_select_db ('kirewire_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>');

}
$result = mysql_query ($query);

$query = 'SELECT * FROM home';

print "<p><h3>{$result}</h3>
</p><hr />\n";
mysql_close(); // Close the database connection.
?>

on the update site it looks like this:

// Define the query.
$query = "Update home Set body = '($_POST)'";

// Execute the query.
if (@mysql_query ($query)) {
print '<p>Your site has been updated!.</p>';
} else {
print "<p>Sorry by your site could not be updated because: <b>" .
mysql_error() . "</b>. The query was $query.</p>";
}

mysql_close();

}

// Display the form.
?>

so many sites so little time wrote:
i tried to fix it getting
Parse error: syntax error, unexpected T_STRING in
/home/kirewire/public_html/pp2/index.php on line 222

for

...ini_set ('display_errors', 1);
error_reporting (E_ALL & ~E_NOTICE);

// Connect and select.
if ($dbc = mysql_connect ('localhost', 'kirewire', 'erikwire')) {

if (!mysql_select_db ('kirewire_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>');
$query = SELECT body from home;

print "<p><h3>{$$query}</h3>
</p><hr />\n";
}

mysql_close(); // Close the database connection.
?>
so many sites so little time wrote:
im really stuck what would work in this case all im trying to do with
that $show is to query the data base to select from table home the info
in column body and print it to the screen
so many sites so little time wrote:
woops sorry its /tpp why isnt it valid syntax :( pay so much for books
that lie ;_;
Jerry Stuckle wrote:
so many sites so little time wrote:
to see a test of this go to www.kirewire.com/ttp/index.php
>
so many sites so little time wrote:
>
>>the table is head the colunm is called body
>>
>><?php //show_site.php
>>// This script retrieves blog entries from the database.
>>
>>// Address error handing.
>>ini_set ('display_errors', 1);
>>error_reporting (E_ALL & ~E_NOTICE);
>>
>>// 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;)
>>
>> print "<p><h3>{$show}</h3>
>> </p><hr />\n";
>> }
>>
>>mysql_close(); // Close the database connection.
>>?>
>
>

Not Found
The requested URL /ttp/index.php was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use
an ErrorDocument to handle the request.
Apache/1.3.37 Server at www.kirewire.com Port 80

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Nov 19 '06 #8
"so many sites so little time" <kk*****@gmail.comwrote:
>
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 <h3tag into a <ptag.
--
Tim Roberts, ti**@probo.com
Providenza & Boekelheide, Inc.
Nov 19 '06 #9
so many sites so little time wrote:
alright so this is where im at, i did this and now it says it works but
jerry knows that i resolved my problem earlier with
www.kirewire.com/tpp2/update_site.php now i just fixed the problem with
kirewire.com/tpp2/index.php but nothing shows up on the index site but
i get no errors on the index site it looks like this

if ($dbc = mysql_connect ('localhost', 'kirewire', 'erikwire')) {

if (!mysql_select_db ('kirewire_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>');

}
$result = mysql_query ($query);

$query = 'SELECT * FROM home';

print "<p><h3>{$result}</h3>
</p><hr />\n";
mysql_close(); // Close the database connection.
?>

on the update site it looks like this:

// Define the query.
$query = "Update home Set body = '($_POST)'";

// Execute the query.
if (@mysql_query ($query)) {
print '<p>Your site has been updated!.</p>';
} else {
print "<p>Sorry by your site could not be updated because: <b>" .
mysql_error() . "</b>. The query was $query.</p>";
}

mysql_close();

}

// Display the form.
?>

so many sites so little time wrote:
>>i tried to fix it getting
Parse error: syntax error, unexpected T_STRING in
/home/kirewire/public_html/pp2/index.php on line 222

for

...ini_set ('display_errors', 1);
error_reporting (E_ALL & ~E_NOTICE);

// Connect and select.
if ($dbc = mysql_connect ('localhost', 'kirewire', 'erikwire')) {

if (!mysql_select_db ('kirewire_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>');
$query = SELECT body from home;

print "<p><h3>{$$query}</h3>
</p><hr />\n";
}

mysql_close(); // Close the database connection.
?>
so many sites so little time wrote:
>>>im really stuck what would work in this case all im trying to do with
that $show is to query the data base to select from table home the info
in column body and print it to the screen
so many sites so little time wrote:

woops sorry its /tpp why isnt it valid syntax :( pay so much for books
that lie ;_;
Jerry Stuckle wrote:

>so many sites so little time wrote:
>
>>to see a test of this go to www.kirewire.com/ttp/index.php
>>
>>so many sites so little time wrote:
>>
>>
>>>the table is head the colunm is called body
>>>
>>><?php //show_site.php
>>>// This script retrieves blog entries from the database.
>>>
>>>// Address error handing.
>>>ini_set ('display_errors', 1);
>>>error_reporting (E_ALL & ~E_NOTICE);
>>>
>>>// 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;)
>>>
>>> print "<p><h3>{$show}</h3>
>>> </p><hr />\n";
>>> }
>>>
>>>mysql_close(); // Close the database connection.
>>>?>
>>
>>
>Not Found
>The requested URL /ttp/index.php was not found on this server.
>
>Additionally, a 404 Not Found error was encountered while trying to use
>an ErrorDocument to handle the request.
>Apache/1.3.37 Server at www.kirewire.com Port 80
>
>--
>==================
>Remove the "x" from my email address
>Jerry Stuckle
>JDS Computer Training Corp.
>js*******@attglobal.net
>==================

Not Found
The requested URL /tpp2/index.php was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use
an ErrorDocument to handle the request.
Apache/1.3.37 Server at www.kirewire.com Port 80

And you'll get more help when you learn to post properly.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Nov 19 '06 #10
gah sorry let me copy and paste it i didnt put it in the directory and
its such a stupid directory name that i keep forgetting exactly what it
is... http://kirewire.com/pp2/index.php
Jerry Stuckle wrote:
so many sites so little time wrote:
alright so this is where im at, i did this and now it says it works but
jerry knows that i resolved my problem earlier with
www.kirewire.com/tpp2/update_site.php now i just fixed the problem with
kirewire.com/tpp2/index.php but nothing shows up on the index site but
i get no errors on the index site it looks like this

if ($dbc = mysql_connect ('localhost', 'kirewire', 'erikwire')) {

if (!mysql_select_db ('kirewire_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>');

}
$result = mysql_query ($query);

$query = 'SELECT * FROM home';

print "<p><h3>{$result}</h3>
</p><hr />\n";
mysql_close(); // Close the database connection.
?>

on the update site it looks like this:

// Define the query.
$query = "Update home Set body = '($_POST)'";

// Execute the query.
if (@mysql_query ($query)) {
print '<p>Your site has been updated!.</p>';
} else {
print "<p>Sorry by your site could not be updated because: <b>" .
mysql_error() . "</b>. The query was $query.</p>";
}

mysql_close();

}

// Display the form.
?>

so many sites so little time wrote:
>i tried to fix it getting
Parse error: syntax error, unexpected T_STRING in
/home/kirewire/public_html/pp2/index.php on line 222

for

...ini_set ('display_errors', 1);
error_reporting (E_ALL & ~E_NOTICE);

// Connect and select.
if ($dbc = mysql_connect ('localhost', 'kirewire', 'erikwire')) {

if (!mysql_select_db ('kirewire_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>');
$query = SELECT body from home;

print "<p><h3>{$$query}</h3>
</p><hr />\n";
}

mysql_close(); // Close the database connection.
?>
so many sites so little time wrote:

im really stuck what would work in this case all im trying to do with
that $show is to query the data base to select from table home the info
in column body and print it to the screen
so many sites so little time wrote:

woops sorry its /tpp why isnt it valid syntax :( pay so much for books
that lie ;_;
Jerry Stuckle wrote:

so many sites so little time wrote:

>to see a test of this go to www.kirewire.com/ttp/index.php
>
>so many sites so little time wrote:
>
>
>>the table is head the colunm is called body
>>
>><?php //show_site.php
>>// This script retrieves blog entries from the database.
>>
>>// Address error handing.
>>ini_set ('display_errors', 1);
>>error_reporting (E_ALL & ~E_NOTICE);
>>
>>// 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;)
>>
>> print "<p><h3>{$show}</h3>
>> </p><hr />\n";
>> }
>>
>>mysql_close(); // Close the database connection.
>>?>
>
>
Not Found
The requested URL /ttp/index.php was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use
an ErrorDocument to handle the request.
Apache/1.3.37 Server at www.kirewire.com Port 80

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Not Found
The requested URL /tpp2/index.php was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use
an ErrorDocument to handle the request.
Apache/1.3.37 Server at www.kirewire.com Port 80

And you'll get more help when you learn to post properly.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Nov 19 '06 #11
and the other one is http://kirewire.com/pp2/update_site.php
i just dont understand why that doesnt work i cant find anything that
would suggest that that shouldnt work.
so many sites so little time wrote:
gah sorry let me copy and paste it i didnt put it in the directory and
its such a stupid directory name that i keep forgetting exactly what it
is... http://kirewire.com/pp2/index.php
Jerry Stuckle wrote:
so many sites so little time wrote:
alright so this is where im at, i did this and now it says it works but
jerry knows that i resolved my problem earlier with
www.kirewire.com/tpp2/update_site.php now i just fixed the problem with
kirewire.com/tpp2/index.php but nothing shows up on the index site but
i get no errors on the index site it looks like this
>
if ($dbc = mysql_connect ('localhost', 'kirewire', 'erikwire')) {
>
if (!mysql_select_db ('kirewire_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>');
>
}
$result = mysql_query ($query);
>
$query = 'SELECT * FROM home';
>
print "<p><h3>{$result}</h3>
</p><hr />\n";
>
>
mysql_close(); // Close the database connection.
?>
>
on the update site it looks like this:
>
// Define the query.
$query = "Update home Set body = '($_POST)'";
>
// Execute the query.
if (@mysql_query ($query)) {
print '<p>Your site has been updated!.</p>';
} else {
print "<p>Sorry by your site could not be updated because: <b>" .
mysql_error() . "</b>. The query was $query.</p>";
}
>
mysql_close();
>
}
>
// Display the form.
?>
>
so many sites so little time wrote:
>
>>i tried to fix it getting
>>Parse error: syntax error, unexpected T_STRING in
>>/home/kirewire/public_html/pp2/index.php on line 222
>>
>>for
>>
>>...ini_set ('display_errors', 1);
>>error_reporting (E_ALL & ~E_NOTICE);
>>
>>// Connect and select.
>>if ($dbc = mysql_connect ('localhost', 'kirewire', 'erikwire')) {
>>
>> if (!mysql_select_db ('kirewire_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>');
>>
>>
>>$query = SELECT body from home;
>>
>> print "<p><h3>{$$query}</h3>
>> </p><hr />\n";
>> }
>>
>>mysql_close(); // Close the database connection.
>>?>
>>so many sites so little time wrote:
>>
>>>im really stuck what would work in this case all im trying to do with
>>>that $show is to query the data base to select from table home the info
>>>in column body and print it to the screen
>>>so many sites so little time wrote:
>>>
>>>>woops sorry its /tpp why isnt it valid syntax :( pay so much for books
>>>>that lie ;_;
>>>>Jerry Stuckle wrote:
>>>>
>>>>>so many sites so little time wrote:
>>>>>
>>>>>>to see a test of this go to www.kirewire.com/ttp/index.php
>>>>>>
>>>>>>so many sites so little time wrote:
>>>>>>
>>>>>>
>>>>>>>the table is head the colunm is called body
>>>>>>>
>>>>>>><?php //show_site.php
>>>>>>>// This script retrieves blog entries from the database.
>>>>>>>
>>>>>>>// Address error handing.
>>>>>>>ini_set ('display_errors', 1);
>>>>>>>error_reporting (E_ALL & ~E_NOTICE);
>>>>>>>
>>>>>>>// 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;)
>>>>>>>
>>>>>>> print "<p><h3>{$show}</h3>
>>>>>>> </p><hr />\n";
>>>>>>> }
>>>>>>>
>>>>>>>mysql_close(); // Close the database connection.
>>>>>>>?>
>>>>>>
>>>>>>
>>>>>Not Found
>>>>>The requested URL /ttp/index.php was not found on this server.
>>>>>
>>>>>Additionally, a 404 Not Found error was encountered while trying to use
>>>>>an ErrorDocument to handle the request.
>>>>>Apache/1.3.37 Server at www.kirewire.com Port 80
>>>>>
>>>>>--
>>>>>==================
>>>>>Remove the "x" from my email address
>>>>>Jerry Stuckle
>>>>>JDS Computer Training Corp.
>>>>>js*******@attglobal.net
>>>>>==================
>
>
Not Found
The requested URL /tpp2/index.php was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use
an ErrorDocument to handle the request.
Apache/1.3.37 Server at www.kirewire.com Port 80

And you'll get more help when you learn to post properly.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Nov 19 '06 #12
ok here is the code i am working off of and they embed the h3 tag i
dont think larry ulman would lie to me :(

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html;
charset=iso-8859-1" />
<title>View My Blog</title>
</head>
<body>
<?php // Script 12.6 - view_blog.php
// This script retrieves blog entries from the database.

// Address error handing.
ini_set ('display_errors', 1);
error_reporting (E_ALL & ~E_NOTICE);

// Connect and select.
if ($dbc = @mysql_connect ('localhost', 'username', 'password')) {

if (!@mysql_select_db ('myblog')) {
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>');
}

// Define the query.
$query = 'SELECT * FROM blog_entries ORDER BY date_entered DESC';

if ($r = mysql_query ($query)) { // Run the query.

// Retrieve and print every record.
while ($row = mysql_fetch_array ($r)) {
print "<p><h3>{$row['title']}</h3>
{$row['entry']}<br />
<a href=\"edit_entry.php?id={$row['blog_id']}\">Edit</a>
<a href=\"delete_entry.php?id={$row['blog_id']}\">Delete</a>
</p><hr />\n";
}

} else { // Query didn't run.
die ('<p>Could create the table because: <b>' . mysql_error() . "</b>.
The query was $query.</p>");
} // End of query IF.

mysql_close(); // Close the database connection.

?>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html;
charset=iso-8859-1" />
<title>View My Blog</title>
</head>
<body>
<?php // Script 12.6 - view_blog.php
// This script retrieves blog entries from the database.

// Address error handing.
ini_set ('display_errors', 1);
error_reporting (E_ALL & ~E_NOTICE);

// Connect and select.
if ($dbc = @mysql_connect ('localhost', 'username', 'password')) {

if (!@mysql_select_db ('myblog')) {
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>');
}

// Define the query.
$query = 'SELECT * FROM blog_entries ORDER BY date_entered DESC';

if ($r = mysql_query ($query)) { // Run the query.

// Retrieve and print every record.
while ($row = mysql_fetch_array ($r)) {
print "<p><h3>{$row['title']}</h3>
{$row['entry']}<br />
<a href=\"edit_entry.php?id={$row['blog_id']}\">Edit</a>
<a href=\"delete_entry.php?id={$row['blog_id']}\">Delete</a>
</p><hr />\n";
}

} else { // Query didn't run.
die ('<p>Could create the table because: <b>' . mysql_error() . "</b>.
The query was $query.</p>");
} // End of query IF.

mysql_close(); // Close the database connection.

?>
</body>
</html>
so many sites so little time wrote:
gah sorry let me copy and paste it i didnt put it in the directory and
its such a stupid directory name that i keep forgetting exactly what it
is... http://kirewire.com/pp2/index.php
Jerry Stuckle wrote:
so many sites so little time wrote:
alright so this is where im at, i did this and now it says it works but
jerry knows that i resolved my problem earlier with
www.kirewire.com/tpp2/update_site.php now i just fixed the problem with
kirewire.com/tpp2/index.php but nothing shows up on the index site but
i get no errors on the index site it looks like this
>
if ($dbc = mysql_connect ('localhost', 'kirewire', 'erikwire')) {
>
if (!mysql_select_db ('kirewire_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>');
>
}
$result = mysql_query ($query);
>
$query = 'SELECT * FROM home';
>
print "<p><h3>{$result}</h3>
</p><hr />\n";
>
>
mysql_close(); // Close the database connection.
?>
>
on the update site it looks like this:
>
// Define the query.
$query = "Update home Set body = '($_POST)'";
>
// Execute the query.
if (@mysql_query ($query)) {
print '<p>Your site has been updated!.</p>';
} else {
print "<p>Sorry by your site could not be updated because: <b>" .
mysql_error() . "</b>. The query was $query.</p>";
}
>
mysql_close();
>
}
>
// Display the form.
?>
>
so many sites so little time wrote:
>
>>i tried to fix it getting
>>Parse error: syntax error, unexpected T_STRING in
>>/home/kirewire/public_html/pp2/index.php on line 222
>>
>>for
>>
>>...ini_set ('display_errors', 1);
>>error_reporting (E_ALL & ~E_NOTICE);
>>
>>// Connect and select.
>>if ($dbc = mysql_connect ('localhost', 'kirewire', 'erikwire')) {
>>
>> if (!mysql_select_db ('kirewire_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>');
>>
>>
>>$query = SELECT body from home;
>>
>> print "<p><h3>{$$query}</h3>
>> </p><hr />\n";
>> }
>>
>>mysql_close(); // Close the database connection.
>>?>
>>so many sites so little time wrote:
>>
>>>im really stuck what would work in this case all im trying to do with
>>>that $show is to query the data base to select from table home the info
>>>in column body and print it to the screen
>>>so many sites so little time wrote:
>>>
>>>>woops sorry its /tpp why isnt it valid syntax :( pay so much for books
>>>>that lie ;_;
>>>>Jerry Stuckle wrote:
>>>>
>>>>>so many sites so little time wrote:
>>>>>
>>>>>>to see a test of this go to www.kirewire.com/ttp/index.php
>>>>>>
>>>>>>so many sites so little time wrote:
>>>>>>
>>>>>>
>>>>>>>the table is head the colunm is called body
>>>>>>>
>>>>>>><?php //show_site.php
>>>>>>>// This script retrieves blog entries from the database.
>>>>>>>
>>>>>>>// Address error handing.
>>>>>>>ini_set ('display_errors', 1);
>>>>>>>error_reporting (E_ALL & ~E_NOTICE);
>>>>>>>
>>>>>>>// 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;)
>>>>>>>
>>>>>>> print "<p><h3>{$show}</h3>
>>>>>>> </p><hr />\n";
>>>>>>> }
>>>>>>>
>>>>>>>mysql_close(); // Close the database connection.
>>>>>>>?>
>>>>>>
>>>>>>
>>>>>Not Found
>>>>>The requested URL /ttp/index.php was not found on this server.
>>>>>
>>>>>Additionally, a 404 Not Found error was encountered while trying to use
>>>>>an ErrorDocument to handle the request.
>>>>>Apache/1.3.37 Server at www.kirewire.com Port 80
>>>>>
>>>>>--
>>>>>==================
>>>>>Remove the "x" from my email address
>>>>>Jerry Stuckle
>>>>>JDS Computer Training Corp.
>>>>>js*******@attglobal.net
>>>>>==================
>
>
Not Found
The requested URL /tpp2/index.php was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use
an ErrorDocument to handle the request.
Apache/1.3.37 Server at www.kirewire.com Port 80

And you'll get more help when you learn to post properly.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Nov 19 '06 #13
this is the statement im using now and it looks clean to me but doenst
work and doesnt give me an error

$query = 'SELECT * FROM home';

if ($result = mysql_query ($query))

print "<p><h3>{$result}</h3>
</p><hr />\n";
}

so im guessing that ($result doesnt = mysql_query (query))
but why what am i doing wrong?
so many sites so little time wrote:
and the other one is http://kirewire.com/pp2/update_site.php
i just dont understand why that doesnt work i cant find anything that
would suggest that that shouldnt work.
so many sites so little time wrote:
gah sorry let me copy and paste it i didnt put it in the directory and
its such a stupid directory name that i keep forgetting exactly what it
is... http://kirewire.com/pp2/index.php
Jerry Stuckle wrote:
so many sites so little time wrote:
alright so this is where im at, i did this and now it says it works but
jerry knows that i resolved my problem earlier with
www.kirewire.com/tpp2/update_site.php now i just fixed the problem with
kirewire.com/tpp2/index.php but nothing shows up on the index site but
i get no errors on the index site it looks like this

if ($dbc = mysql_connect ('localhost', 'kirewire', 'erikwire')) {

if (!mysql_select_db ('kirewire_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>');

}
$result = mysql_query ($query);

$query = 'SELECT * FROM home';

print "<p><h3>{$result}</h3>
</p><hr />\n";


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

on the update site it looks like this:

// Define the query.
$query = "Update home Set body = '($_POST)'";

// Execute the query.
if (@mysql_query ($query)) {
print '<p>Your site has been updated!.</p>';
} else {
print "<p>Sorry by your site could not be updated because: <b>" .
mysql_error() . "</b>. The query was $query.</p>";
}

mysql_close();

}

// Display the form.
?>

so many sites so little time wrote:

>i tried to fix it getting
>Parse error: syntax error, unexpected T_STRING in
>/home/kirewire/public_html/pp2/index.php on line 222
>
>for
>
>...ini_set ('display_errors', 1);
>error_reporting (E_ALL & ~E_NOTICE);
>
>// Connect and select.
>if ($dbc = mysql_connect ('localhost', 'kirewire', 'erikwire')) {
>
> if (!mysql_select_db ('kirewire_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>');
>
>
>$query = SELECT body from home;
>
> print "<p><h3>{$$query}</h3>
> </p><hr />\n";
> }
>
>mysql_close(); // Close the database connection.
>?>
>so many sites so little time wrote:
>
>>im really stuck what would work in this case all im trying to do with
>>that $show is to query the data base to select from table home the info
>>in column body and print it to the screen
>>so many sites so little time wrote:
>>
>>>woops sorry its /tpp why isnt it valid syntax :( pay so much for books
>>>that lie ;_;
>>>Jerry Stuckle wrote:
>>>
>>>>so many sites so little time wrote:
>>>>
>>>>>to see a test of this go to www.kirewire.com/ttp/index.php
>>>>>
>>>>>so many sites so little time wrote:
>>>>>
>>>>>
>>>>>>the table is head the colunm is called body
>>>>>>
>>>>>><?php //show_site.php
>>>>>>// This script retrieves blog entries from the database.
>>>>>>
>>>>>>// Address error handing.
>>>>>>ini_set ('display_errors', 1);
>>>>>>error_reporting (E_ALL & ~E_NOTICE);
>>>>>>
>>>>>>// 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;)
>>>>>>
>>>>>> print "<p><h3>{$show}</h3>
>>>>>> </p><hr />\n";
>>>>>> }
>>>>>>
>>>>>>mysql_close(); // Close the database connection.
>>>>>>?>
>>>>>
>>>>>
>>>>Not Found
>>>>The requested URL /ttp/index.php was not found on this server.
>>>>
>>>>Additionally, a 404 Not Found error was encountered while trying to use
>>>>an ErrorDocument to handle the request.
>>>>Apache/1.3.37 Server at www.kirewire.com Port 80
>>>>
>>>>--
>>>>==================
>>>>Remove the "x" from my email address
>>>>Jerry Stuckle
>>>>JDS Computer Training Corp.
>>>>js*******@attglobal.net
>>>>==================


>
Not Found
The requested URL /tpp2/index.php was not found on this server.
>
Additionally, a 404 Not Found error was encountered while trying to use
an ErrorDocument to handle the request.
Apache/1.3.37 Server at www.kirewire.com Port 80
>
And you'll get more help when you learn to post properly.
>
>
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Nov 19 '06 #14
Hi,

[Start Just a friendly word of advise.]
You might get luckier if you follow Jerry's advise and post properly.
This thread you created is a mess, and I gave up at trying to follow your
line of thought/problem somewhere at the end.

Please make sure you understand WHAT you are doing, then make a posting that
clearly describes your problem.
I don't think many in here will read through your whole thread with code,
corrections on the code, new code, top-postings, questions, wrong url, new
code, etc.
It is just too messy. (No offense intended)
[End Just a friendly word of advise.]

Now please restate your problem in a clear way in a fresh thread.
Regards,
Erwin Moller
Nov 19 '06 #15
Please do not top-post.
Please trim unnecessary lines from the quoted articles.
Please read http://www.greenend.org.uk/rjk/2000/06/14/quoting.html
Thank you.

so many sites so little time wrote:
<snip>
$result = mysql_query ($query);

$query = 'SELECT * FROM home';

print "<p><h3>{$result}</h3>
</p><hr />\n";
Wrong order of statements.

*First* you set up variables,
*then* you call mysql_query(),
*then* you call mysql_fetch_*(),
and *last*, in a loop, you print the data.

--
I (almost) never check the dodgeit address.
If you *really* need to mail me, use the address in the Reply-To
header with a message in *plain* *text* *without* *attachments*.
Nov 19 '06 #16
so many sites so little time wrote:
ok here is the code i am working off of and they embed the h3 tag i
dont think larry ulman would lie to me :(
Try the World Wide Web Consortium (W3C) Validator
http://validator.w3.org/

--
I (almost) never check the dodgeit address.
If you *really* need to mail me, use the address in the Reply-To
header with a message in *plain* *text* *without* *attachments*.
Nov 19 '06 #17
i followed erwin mollers advice and started a new thread i dont want it
to be a fetch array i dont want it to loop i only want 1 row of data
which is why i just used SELECT
Pedro Graca wrote:
so many sites so little time wrote:
ok here is the code i am working off of and they embed the h3 tag i
dont think larry ulman would lie to me :(

Try the World Wide Web Consortium (W3C) Validator
http://validator.w3.org/

--
I (almost) never check the dodgeit address.
If you *really* need to mail me, use the address in the Reply-To
header with a message in *plain* *text* *without* *attachments*.
Nov 19 '06 #18
plus that validator just shows errors in the html markup apparently
cause im not getting any php errors and the errors it is showing me
dont matter cause the site still works and those markups its showing me
were generated with dreamweaver 8

so many sites so little time wrote:
i followed erwin mollers advice and started a new thread i dont want it
to be a fetch array i dont want it to loop i only want 1 row of data
which is why i just used SELECT
Pedro Graca wrote:
so many sites so little time wrote:
ok here is the code i am working off of and they embed the h3 tag i
dont think larry ulman would lie to me :(
Try the World Wide Web Consortium (W3C) Validator
http://validator.w3.org/

--
I (almost) never check the dodgeit address.
If you *really* need to mail me, use the address in the Reply-To
header with a message in *plain* *text* *without* *attachments*.
Nov 19 '06 #19
so many sites so little time wrote:
i followed erwin mollers advice and started a new thread i dont want it
to be a fetch array i dont want it to loop i only want 1 row of data
which is why i just used SELECT
Pedro Graca wrote:
>>so many sites so little time wrote:
>>>ok here is the code i am working off of and they embed the h3 tag i
dont think larry ulman would lie to me :(

Try the World Wide Web Consortium (W3C) Validator
http://validator.w3.org/

--
I (almost) never check the dodgeit address.
If you *really* need to mail me, use the address in the Reply-To
header with a message in *plain* *text* *without* *attachments*.

And you're not going to get any answers on that thread either until you
learn how to post properly.

You need to follow ALL of Erwin's advice. It's good.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Nov 19 '06 #20

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Simon Mansfield | last post by:
I have been given a list of exercises to do by my tutor, one of which is this: http://www.cems.uwe.ac.uk/~amclymer/Software%20Design%20and%20C++/Exercises/Exercise%208/Exercise.html Which i am...
3
by: rcamarda | last post by:
I do weekly full backups of my SQL databases via a scheduled T-SQL job. I noticed that I have some static databases that dont normally change, so I dont want to back it up if it has not changed,...
0
by: Mate Visky | last post by:
hi, i have a little problame. i got this xml file: ---- <?xml version="1.0" encoding="UTF-8" ?> - <out> - <design> - <html> - <!]> </html>
5
by: Bradley1234 | last post by:
Typically when passing by reference you point to the location of the variable, and can modify the original When passing by value, you include a disposable copy of the variable, but it protects...
1
by: Merrua | last post by:
I dont understand how to do this I created a dialog based project and that is fine for most of my programming project, but one dialog box is going to generate a graph, and as far as i know from...
4
by: dhnriverside | last post by:
HI guys I've just written my first independent namespace for my library (yay me!). However, on trying to add it to my website project, it causes an error when I look at the website. It compiles...
7
by: Robert Ginsburg | last post by:
I have a mixed mode C++ dll, mostly it is unmanaged code that currently communicates with a remote server over DCOM. I am trying to plug in the new IPCChannel remoting provider to replace the DCOM...
3
by: philelpko | last post by:
Hi all, I have been banging my head against the wall with this one for a while so I now turn to you all for a pointer. I am currently having trouble with error 2448 “You can't assign a value to...
2
by: Richard Coltrane | last post by:
Hello, Can anyone point me in the direction of some good introductory resources to MVC and Web. I have looked up several resources on MVC in general (none of which have any code samples) but I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.