0

Is it possible to embed variable in longtext data field?

For instance:
the field name is "description" and it contains...

The date is $date_var.

In PHP/MySQL Query:

$date_var = date('m/d/Y');
echo $row['description'];

The output should be:

The date is 10/14/2012.

please advise.

4
Contributors
4
Replies
5
Views
5 Years
Discussion Span
Last Post by edsweng
0

Yes

<?php

$age = "really really really old :)";

?>

<h1>You are <?php echo $age; ?></h1>

NOTE
The cuse of age in this post is no idictaion of being agest

Edited by Squidge

0

I think the OP wants to know if he can store a PHP variable and a text string, in the mysql field. Presumably so that when he selects the data from the dbase, PHP parses the variable and changes it for the current date.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.