|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
PHP code in mysql tables
Is this allowed in PHP/MYSQL?
Is there away to store and display a document in Table that contains queries to other tables? eg. I am trying to make the following work from a stored document: <center><p><FONT size='+2' color='blue'>Welcome to the ***** Club of <br><?print $qry[ClubName];?></FONT> <br>The club welcomes visiting members and their guests. <br>We do hope that you can join us for our weekly meeting at<br> <?print $qry[MeetVenue];?>.</p> <p>We meet nearly every <?print $qry[MeetDay];?> at <?print $qry[MeetTime];?>. </p> </center> |
|
#2
|
||||
|
||||
|
RE: PHP code in mysql tables
I'm not 100% sure if you can store queries (I think you can as strings that will be interpreted as queries but why?) in the database but you can easily store the data you are requesting in a db.
You give each club an ID and you pull back your data with a SELECT * FROM clubs WHERE id = '$clubnum' then you would bring out the data you were looking for as elements of the table, in other words name, venue and meeting_time would all be fields in the table. |
|
#3
|
||||
|
||||
|
RE: PHP code in mysql tables
on rereading your question, you can probably store the code you wrote in a blob with some special attention paid to special characters, like addslashes() and stripslashes(), I know certain bulletin boards handle this but they do it so that it can be displayed as text rather than run.
|
|
#4
|
|||
|
|||
|
RE: PHP code in mysql tables
I just want to store this text in a db "Hello Mr. $lname" and then have it display on the site as "Hello Mr. Smith". I have $lname declared properly and all, but I can't get it to display the value of $lname. It either shows '$lname' or is null....Any ideas? I'm at my wit's end.
Thanks. |
|
#5
|
|||
|
|||
|
RE: PHP code in mysql tables
You can't do it like that. You got to store the real name (Smith) in your tables... then you'll get out of it what you need
|
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Database Help > PHP code in mysql tables |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|