Jump to content

weldonj

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

weldonj's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I have a script that calls last modified and the current time. When first uploaded the current time is always like 46 seconds ahead of the getlastmod(); echo "Last modified: " . date ("F d Y H:i:s.", getlastmod()); echo "Last modified: " . date ("F d Y H:i:s.", time()); the getlastmod will be in the future? Is this a bug?
  2. Does it make a difference that description is getting called from a mysql database using myrow. Suppose in my database the field description is: This is a $test If I pull from the database and do: $test="real name"; $sql = "my select statement"; $result = mysql_query($sql) or die(mysql_error()); while ($myrow = mysql_fetch_array($result)) { $description=$myrow["description"]; } eval('echo $description;'); My output is "this is a $test" however if I instead do this: $test="real name"; //replacing the  $description=myrow["$description"] below; $description="This is a $test";  eval('echo $description;'); then i get the correct "this is a real name" So clearly the $description=myrow["$description"] line is screwing things up. Can anyone explain to me how to get around this? or why this is causing problems. Thanks
  3. I'm not sure how to get eval to work.  Not all of my database entries will have php variables in them. I do return eval($description); where description="database entry i want my $phpvariable;?> here"; and i keep getting database entry i want my $phpvariable?> here"; The docs on eval have been of no helps so if anyone could show me how to embed the php variable in my mysql database it would be appreciated.
  4. I'm trying to figure out how to store php variables within mysql fields and then call these nested php variables. Say I have mysql field "descriptio"n which is a bunch of text: description="mostly text but i sometimes want  a php variable called $id and get its value" but then when I try and echo this row in php: echo $description; my output will be "mostly text but i sometimes want  a php variable called $id and get its value" I tried different things within mysql and the field description: description="mostly text but i sometimes want  a php variable called <?php echo $id;?> and get its value" but then myoutput is just: "mostly text but i sometimes want  a php variable called $id and get its value <?php echo $id;?> and get its value"; i can't believe i can't figure this out. I think eval might help me out but I've tried various combinations and had no luck.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.