473,472 Members | 2,191 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

PHP and MSSQL - executing php code from mssql

3 New Member
Hi, I would like to know if this is possible, I have a sql table that has a paragraph in a varchar field. I can query the database and pull this field in, it renders perfectly, except for the php code that is in the text. Can php be executed from within the results of a sql query, if so, how? (if it is relevant, I am using mssql, php and iis)

Here is the text (snip) - (how it looks in view source):
Expand|Select|Wrap|Line Numbers
  1. Such breakdowns can temporarily leave families scrambling for care at the last minute.</p><p class="body_copy_12on14"> <?php  echo $_SESSION['nameCompany']; ?> offers its employees
  2.  
Here is the text (snip) - (how it looks on the web page):
Expand|Select|Wrap|Line Numbers
  1. Such breakdowns can temporarily leave families scrambling for care at the last minute. offers its employees
  2.  
The php code executes fine if I type it into the page directly, so I know that the session is set (btw, I changed the php code in the paragraph in sql and just tested "hello" and that would not execute either)...

anyone know how I can make this work? Thanks so much....

Laura
Oct 5 '07 #1
3 1506
Atli
5,058 Recognized Expert Expert
Hi Laura. Welcome to The Scripts!

The PHP code is not getting executed because it is being handled as a string and sent to the browser.

Try running it through the eval() function.
Oct 5 '07 #2
laural4705
3 New Member
Thank you so much, this is just what I was looking for!

:)

You made my day!
Oct 6 '07 #3
Atli
5,058 Recognized Expert Expert
Glad I could help :)

Don't hesitate to post again if you have any more questions or problems we can help with.
Oct 6 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: badz | last post by:
Hi frenz Lately I try to use MSSQL and PHP , the problem arise when PHP try to read MSSQL field with 'image' data type, header("Content-type: image/jpeg"); // act as a jpg file to browser I...
7
by: mj | last post by:
Hello, thanks for the help. I am running a WinXP Pro w/ SP2 (my home computer, with ZoneAlarm firewall) Apache 2.0.52 MySQL 4.1.7 PHP 5.1.0-dev I have developed a PHP/MySQL web app that...
1
by: Khai Mun, Ng | last post by:
Hi, Does anyone try before using ASP to execute JOB in MSSQL? Thank you Regard, -- Khai Mun, Ng
1
by: Cibulya Dmitriy | last post by:
Hi All, I want to catch the next MSSQL error in my SQL code with following continue calculations Server: Msg 17, Level 16, State 1, Line 1 SQL Server does not exist or access denied.
2
by: Ian Hinson | last post by:
Hi, Sometimes I find it handy to construct an sql string for action queries, and then run it directly against the database and/or connection instead of using Recordsets for simple updates. eg....
3
by: Uncle Sam | last post by:
Hi, Please confirm.. is it possible to connect to MSSQL server by executing a shell script on HP-UX (UNIX) platform. Regards, Uncle Sam
0
by: LizRickaby | last post by:
My client has several Access databased that they wanted converted into MSSQL to be able to access them online (excuse the pun). I added the first Access database, LenderPrograms, as a table in the...
14
by: guswebb | last post by:
Hi. I'm a newbie to PHP and am having a few problems as follows... I have installed PHP successfully on server 1 which is running IIS 6 (W2k3) and hosting multiple sites, some of which connect to...
3
by: tiptap | last post by:
Hey, I have a really confusing problem here. I'm using MSSQL & PHP. I have created a querry in MSSQL that basically shows a list of events and shows them in date order. I have written a bit of...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.