Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
PHP Echo in MySQL driven page. need help.
Old 11-05-2006, 04:24 AM PHP Echo in MySQL driven page. need help.
OTO
OTO's Avatar
Experienced Talker

Posts: 44
Location: Tbilisi, Georgia
Trades: 0
Hello all

I need your help in PHP/MySQL...

I have 1 table in MySQL with 1 row. Values:
id = 1
text = Simple Test Text. <?php echo "php echo test"; ?> blah blah blah...

I try to echo this text with <?php ?> echo in simple page. can you tell me how to do this? :roll:

Code:
$query = "SELECT id, text FROM table1 WHERE id = 1 "; 
mysql_query($query) or die("Error!");
while ($row = mysql_fetch_array($result)) {
$text = $row['text'];
echo "$text";
}
Any idea?
__________________
Nothing Is Impossible!
OTO is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-05-2006, 06:54 AM Re: PHP Echo in MySQL driven page. need help.
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Do we take it that you want to actually run the PHP code in your text field ??


if so http://uk.php.net/eval
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-05-2006, 09:00 AM Re: PHP Echo in MySQL driven page. need help.
Smaaz's Avatar
Experienced Talker

Posts: 41
Trades: 0
Code:
<?php
$fetch = mysql_fetch_array(mysql_query("SELECT id, text FROM table1")); $text = $fetch[text]; ?> Some text ... <?php echo $text; ?> ... some more text
__________________

Please login or register to view this content. Registration is FREE
~~
Please login or register to view this content. Registration is FREE
~~
Please login or register to view this content. Registration is FREE
~~
Please login or register to view this content. Registration is FREE
Smaaz is offline
Reply With Quote
View Public Profile Visit Smaaz's homepage!
 
Old 11-05-2006, 09:32 AM Re: PHP Echo in MySQL driven page. need help.
OTO
OTO's Avatar
Experienced Talker

Posts: 44
Location: Tbilisi, Georgia
Trades: 0
Problem solved, thank you for attention
__________________
Nothing Is Impossible!
OTO is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to PHP Echo in MySQL driven page. need help.
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13587 seconds with 12 queries