hello list. i have a problem that is relatively simple, but I can't seem to figure it 
out.
is there any way to define a variable by querying a MySQL database?
here's an example of code I tried using:

----------------------------------------------------------------
<?
$WELCOME = "
echo "<?php
$link = mysql_connect("localhost","username","password");
if(!$link) die ("Could not connect to MySQL!");
mysql_select_db("database",$link);
$result = mysql_query("select * from table_name);
$num=mysql_numrows($result);
for($x=0;$x<$num;$x++) {
$row=mysql_fetch_object($result);
print "$row->my_name";
}
mysql_close($link);
?>
";
";
?>

<? echo($WELCOME); ?>

----------------------------------------------------------------



it kept coming up with the following :

----------------------------------------------------------------
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in 
c:\apache group\apache\htdocs\page.php on line 5
----------------------------------------------------------------


i can't figure out what to do, so if anyone can assist me, i'd be greatful. I have a 
feeling it's something with some quotes but i can't figure out which ones.


Thanks a lot,


Matt Nigh
[EMAIL PROTECTED]





Reply via email to