Database Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesDatabase Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old July 28th, 2003, 07:39 AM
huttfan huttfan is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 2 huttfan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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>

Reply With Quote
  #2  
Old July 28th, 2003, 07:47 AM
bakertrg's Avatar
bakertrg bakertrg is offline
Contributing User
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: Scottsdale AZ, US
Posts: 2,253 bakertrg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 48 m 45 sec
Reputation Power: 4
Send a message via Yahoo to bakertrg
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.

Reply With Quote
  #3  
Old July 28th, 2003, 07:53 AM
bakertrg's Avatar
bakertrg bakertrg is offline
Contributing User
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: Scottsdale AZ, US
Posts: 2,253 bakertrg User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 48 m 45 sec
Reputation Power: 4
Send a message via Yahoo to bakertrg
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.

Reply With Quote
  #4  
Old October 17th, 2003, 03:28 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
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.

Reply With Quote
  #5  
Old October 17th, 2003, 03:33 PM
CodeKadiya CodeKadiya is offline
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: Colombo,Sri Lanka
Posts: 2,313 CodeKadiya User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
Send a message via Yahoo to CodeKadiya
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

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesDatabase Help > PHP code in mysql tables


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT