473,388 Members | 1,230 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Run a script from within a script

code green
1,726 Expert 1GB
I am writing a script 'stockAvailibilty.php' that creates a spreadsheet of stock availability from a MySql database.
But the MySql database needs updating from a MsSql database first, and
I have a script that succesfully does this 'updateStockLevel.php'..
So what is the best way to run 'updateStockLevel.php' from 'stockAvailibilty.php'
prior to the rest of the script executing.
I prefer not to use 'include' because they both share similar classes and functions that will cause a redeclaration headache.
Also it needs to allow time for the MySql database to finish its UPDATE
Nov 2 '07 #1
4 1413
pimmy
9
Have you thought of calling a procedure from your PHP script which will first update the database and then get you the data?

Cheers,
Pimmy
Nov 2 '07 #2
code green
1,726 Expert 1GB
Updating the MySql DB from the MsSQl is quite complex, involving calculations and multiple SELECTs.
updateStockLevel.php achieves this but needs to remain as a standalone because this is a seperate script running on a scheduled task.
I don't want to copy all this code (200 lines + mutiple class and function includes) in to stockAvailibility.php because it would need some re-writing.
I just want to run updateStockLevel.php from stockAvailibility.php.
Nov 2 '07 #3
pimmy
9
Then would this work for you:

shell_exec('php updateStockLevel.php');

Cheers,

Pimmy
Nov 2 '07 #4
code green
1,726 Expert 1GB
Thanks pimmy I will give it a try.
After some Googling I had a look at exec() and system() but didn't seem to be suitable.
There is also a bit of HTML using the src tag <src="updateStockLevel.php">
which I thought was interesting.
Only ever used exec() to run a mysqldump command so I wasn'.t sure how to achieve this.
Nov 2 '07 #5

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

Similar topics

5
by: David M Loraine | last post by:
I am a sql novice and would appreciate any help with the following problem. In a table I have property addresses stored in 6 fields. Field6 always hold the Post Code. However, fields 4 and 5...
6
by: Mike Daniel | last post by:
I am attempting to use document.write(pageVar) that displays a new html page within a pop-up window and the popup is failing. Also note that pageVar is a complete HTML page containing other java...
8
by: Johnny Knoxville | last post by:
I've added a favicon to my site (http://lazyape.filetap.com/) which works fine if you add the site to favourites the normal way, but I have some JavaScript code on a couple of pages with a link,...
5
by: Paul O. Morris | last post by:
Is there a script that I can run to stop a particular SQL server service on Win2003 server? I'm looking for a similar script to restart that service as well. Thanks.
8
by: Brett Robichaud | last post by:
I understand how code-behind can handle events for a page, but can I call a code-behind method from within a <script> tag in my ASP.Net page, or can I only call methods defined in other <script>...
17
by: CES | last post by:
All, I was wondering if their is a way of loading an external script fill from within a script?? <script language="javascript" type="text/javascript"> function test(var){ <script...
3
by: Water Cooler v2 | last post by:
Questions: 1. Can there be more than a single script block in a given HEAD tag? 2. Can there be more than a single script block in a given BODY tag? To test, I tried the following code. None...
2
by: bilaribilari | last post by:
Hi all, I am using Tidy (C) for parsing html pages. I encountered a page that has some script as follows: <script> .... var abc = "<script>some stuff here</" + "script>"; .... </script>
2
by: Yansky | last post by:
Hi, I was just wondering if it is possible to disable script debugging in IE from within a script. I know I can disable it manually through the IE tools menu, but is it possible to disable it from...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
0
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...

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.