Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Please Help: How To Log Data Before Shutdown?


Quick question:
Assume your PHP script is running in the background executing some
long, time consuming process. And while it's running the Host Service
Provider decides to shut down the server for maintenance.

How are running scripts in that case terminated? Will they exit
orderly or will they simply be aborted like pulling the plug?

Will the "register_shutdown_function()" be executed when a server
shut-down exits all running processes?

How can I get my script to write some log data before it is stopped
when the server shuts down or so?




View Complete Forum Thread with Replies

Related Forum Messages:
Shutdown Order
I have this code:

class Test
{
public $status = 'dead'
function __construct() { $this->status = 'alive' }
function __destruct() { echo '<br>__destruct()' }
}
$o = new Test;

function shutdown()
{
echo '<br>shutdown()'
}
register_shutdown_function('shutdown');

function obflush( $s )
{
global $o;
return $s . '<br>obflush() ' . $o->status;
}
ob_start('obflush');

Which (using PHP 5.1.4) produces this output:

shutdown()
__destruct()
obflush() alive

I have two questions:

1) I have read that the order in which the three functions are called has
changed previously and is likely to change again in future versions of PHP.
Does this mean I cannot rely on this order at all?

2) Why is $o still "alive" in obflush() even though its destructor has been
called before? The destructor having been called, I would expect global $o
to point to a no longer existing variable (thus, "null").

View Replies !
Shutdown Computer
I run an online radio station, and am in need of a method to shutdown or restart the computer running the station in case of errors etc. I noticed the delphi program idea someone posted earlier, but I dont have possesion of any way to compile delphi code or any knowledge of delphi. I could use to solve this problem?

View Replies !
Start Up / Shutdown Mysqld In Win98
I can start the mysqld fine by running the following command:
C:mysqlbinmysqld --standalone

and I can shut it down fine with the following command:
c:mysqlbinmysqladmin shutdown

But does anybody know how to set this up in win98 so that it will automatically startup mysqld on startup, and automatically shut it down on shutdown/restart?

View Replies !
Warning: Unknown Persistent List Entry Type In Module Shutdown (11)
I am getting this wanrning:

Warning: Unknown persistent list entry type in module shutdown (11) in Unknown on line 0

I have never seen it before or know what it means and line 0 is hard to find especially when no document is specified Everything works as it should at this point just getting that warning on my personal apache server any ideas?

View Replies !
Simulate Send Data With POST And Get Data From A Web Page (whith A Session)
I'd like to get text of a webpageB that I reach by putting
a login and a password in a webpageA.

I mean:
I'd like to get text of a WebPageB with a php script.
But before I can see WebPageB I have to autenticate myself
in a WebPageA writing my login and my password in a form,
the host recognise me and (by session) let me see the WebPageB.

The question is:
1)how to simulate send data (login an password) in form with a PHP script?
2)how to navigate in a Web usin the same session?

View Replies !
Pull Data From Mysql From A Varchar Field With Comma Seperated Data
I'm trying to pull data from mysql from a varchar field with comma seperated data, like: test, test, test, and so on. when I try to display the data i just get "array" in the input field. what i'm wondering is how can I show the data correctly? I'm a little lost here.

View Replies !
Problems With Reading Data From A Text File And Inserting The Data Into DB
Ive been having problems getting this to work for 3 days now. Basically what im trying to do is read from a text file and insert the information into mysql. The text file is in this format:

"LuCyndi@infiniti.com","carol","kellerhals","109 veeder dr","las vegas","NV","89128","702-254-2061","45"
"the_prophet@att.net","a.","cohen","6794 e. bonanza rd","las vegas","NV","89110","702-463-6569","55"

I understand how to open files to read but im having problems turning each set of data into an array so i may insert it into mysql. If someone could please help it would be appreciated.

View Replies !
Retrieve A Data From My MySQL Database Using PHP And Save The Data In A Variable
How can I retrieve a data from my mySQL database using PHP and save the data in a variable in in my PHP code for example i have this table in the database

First name           Last Name
   Juan                  Punkista

I would like to store 'Juan' in variable $first and 'Punkista' in variable $last.

View Replies !
Is It Data From The TEST Or From PROD And Will It Be Data From Database1 Or From Database 2?
<?php

I have a question about 2 connection strings to a ms sql database.

# TEST DATABASE

$connecttest = MSSQL_CONNECT("TEST", "sa", "123456") or exit("Unable to
connect to MS SQL Server at 10.0.10.58");

$select = mssql_select_db ("database1",$connecttest) or exit("Unable to
select database TEST");

# PRODUCTION DATABASE

$connectprod = MSSQL_CONNECT("PROD", "sa", "654321") or exit("Unable to
connect to database at 10.0.10.59");

$select = mssql_select_db ("database2",$connectprod) or exit("Unable to
select database PROD");

$SQL = "SELECT * FROM table1";

$RESULT = mssql_query($SQL);

// What data will i find here? Is it data from the TEST or from PROD and
will it be data from database1 or from database 2?

?>

View Replies !
Use Sessions To Store Data And Use That Session To Get Query Data.
We have some Java programmers in our software dev, and they are
pressuring us to use Sessions to store data and use that Session to get
query data. They say that it is ok since it is like Entities in Java. I
am baffled as a .NET programmer, we tend to avoid using sessions and
instead use DataSet, is there any equivalent of dataset in PHP?

View Replies !
To Update Data - Reqiures Verify Existing Data?
i have a table with 7 writable fields. i've already populated column1 w/ data. so, 6 fields in each row need updating.

the data in field #1 is a "unique identifier" code, but not the auto_increment field, and therefore should NOT be updated along with its row's neighboring cells.

this "unique Identifier" column is used as a human-friendly reference-point for sifting through records in the table via HTML select dropdown box, and its value should remain static once entered into the db. Code:

View Replies !
Using MS Access To Hold The Data And PHP To Collect The Data From The Database
I am using MS Access to hold the data and PHP to collect the data from the database and display it on a website. I've got the results displaying in the normal way with data being displayed in a linear manner e.g. Code:

View Replies !
Comparing Data In Two Tables To Find Missing Data
I have a small web site where people can register and create an account, and then add links to our site.

I have two tables set up. One holds registration data -- user_id, username, password, date registered. The other holds link data -- link_id, user_id (to track which registrant added which link), and URL.

Some people have created an account, but have never posted a link. I'd like to figure out who those folks are but I'm not quite sure about how to do that.

If I did this manually I would get a list of user id's from the registration table and then look at the link table and check off user id's in that table. The unchecked user id's are my target group.

View Replies !
Comparing Form Data To Mysql Data
Im interested in building a script that would take form data, a variable like an address, and compare it with a known address in a mysql table (called addresses), then if there is a match log the address information in a separate table called (addresslog), and return the visitor to a certain page. If there is no match between the address entered in the form and known addresses then the information is still logged into the addresslog database but the visitor will be sent to a different page.

I'm still new to this, and am working through the logic and the syntax, but I believe I'm close. It's still not working, I have all of the proper tables, maybe I'm way off with the coding so I thought I would seek out some expert advice. Here's the entire script with as much explanation as I could give. PHP Code:

View Replies !
Data Type Change Without Loosing Data
I have a problem in mysql. I stored a date in  08/14/2006 format and choose a datatype longtext now i want to store date in 2006-08-14 form is it possible to do it without loosing data in db when i convert datatype longtext to date the data lost. Any solution?

View Replies !
Showing Data From Data In Specific Interval
i will make a banner system to my website. there is some information in the database i get out with to my site. that is pasteing the data in random way. i have a date with day-month-year and a time .. hour:min. how do i do in my code so its is displayed in ex 1 month from that day it is acceptet. give me an example to how i could do it.

View Replies !
Data Mining / Data/Website Scraping
I'm looking for a piece of software or coding that will let me post a
form
to another URL, accept the response, search it for a specific
"success"
string and then let me continue processing the rest of my program.

I want to accept queries on behalf of my supplier, forward it to them
behind
the scenes, accept their response and display it within my website.

Has anyone had any experience with this? Is there a simple, basic
utility
to let me do this?

I was kind of hoping I could avoid developing it myself.

View Replies !
Possible To Pass And Display The Data Before Some Of Data In Processing?
possible to display the data before some of the data still in processing in server?

I had one page that peform the calculation with more that ten calculation of huge numeric of data and compare between each other. when the user insert all the data and pass to the server, isnt possible we display other data to the user and after the compare process had finish just display the result to the user?

possible to do that? other had other more efficient way to do that?

View Replies !
$_SESSION[] Not Holding Data After Submitting The Data
I'm using $_SESSION[] to store some information, but after I submitted the data using form, the data stored in $SESSION[] disappeared. What could be the reason? Code:

View Replies !
How To Trim Data , Data Retrived From Mysql
I am retriving data from MySql database into table.. the width of the table is 281 so small so i wanted to cut the text say eg. : Today Mr. X-Men is visiting Thimphu for his lates show off movie traillers. I wanted to trim it in this formate : Today Mr. X-Men is visiting Thimphu for ... The rest of the data i can hyperlink this sentence and show it in the another page.. Just like the Yahoo News for ur kind information.

View Replies !
Pull The Data Directly From A Data Feed
I am currently building a site that would be easier if i could pull the data directly from a data feed. ButI'm new to PHP and I don't know how to create a bit of script to do this.

View Replies !
Trouble Appending Data Onto The End Of Form Data
I have a textarea in an html form. Users list items in it.

item1
item2
item3

I then process the form data in php so that a "-" is appened at the beginning and end of each line. Code:

View Replies !
Extracting Data And Syncing Data From 2 Different Databases
Here is my problem. I need to sync up data from 2 separate databases. The data in the first database is stored in one column, here is an example of the data: 3214, 3478, 3100
These number are the idProduct Primary Key from the Products table of the second database.

I need to separate the numbers the coma is the delimiter. each 4 digit number is a different product number from the second database. The site is currently done in ASP and access database. I converted the databases to mySQL and redoing the site in PHP. Code:

View Replies !
Delete Data From The Data Base
Im doing the PHP-MYSQL program to search the data in the database and display on the HTML Page. Everything is working fine till now. Now I want to know that, how to write program to delete the searched and displayed data from the database.....

I know the MySQL Syntax to delete data from database...Im not asking about MySQL programming. I want just an idea, how to do the delete process. Here is My full PHP script, Code:

View Replies !
Comparing Database Data And New Data
I am trying to create a PHP script that reads in a file, parses it for the data I want and compares it to the data I have in a database.

The data is points and ranking information for a Folding@Home Team.  Every week someone creates a news item with points gained by each team member for that week and other info.  This is done manually and takes a lot of time.  I hope for my script to automate as much of it as possible.

The script was to run as follows:

Download and parse latest statistics into 2D array
Compare usernames in array to usernames held in Database
Any new usernames and their respective points/rank to be added to database

Compare points in 2D array of each user to those held in database.
Output username and points gained

I thought I had a working script until I actually tested it on real data, and realised I missed something rather obvious - the order of usernames from the parsed file is not going to be the same order as in my database - due to people moving up and down the ranks.  So i can't just get a recordset from the db and run a simple loop to compare it to the parsed data.

I am not sure how to go about comparing the database information with the parsed data that works around the fact the data could be in any order.  The only thing i can think of is:

foreach item in $parsed_data_array
    query database for $parsed_data_array=>username
        if(number of results == 0)
          build new insert query for current username
        else
          continue

I don't know if this works [haven't tested yet] but I can't help feel it is a little DB intensive.  There could be up to 200 queries being sent to the database.  This can be minimized by adding extra criteria, like ignoring inactive users of course.  Is this a viable solution or is there a much better way of doing this?

View Replies !
Retreiving Data And Maintaining Data
I am trying to add data to a table in oracle but get

Warning: ociexecute(): OCIStmtExecute: ORA-00936: missing expression in /homedir/ilex-s02/mrace/public_html/addnewemp.php on line 18

here is the PHP script i am working with, Can anyone see any faults with it? Code:

View Replies !
Retrieving Data - Strip The Data
This shouldn't be a complicated solution but it's somehow beyond me at the moment. There is a php script on an external server that is writing javascript document.writes that we are supposed to include in our html files.

However, we don't like the layout so I'm trying to strip the data we don't (shouldn't be a problem) but for something reason I can't get php to read it. It's not a php problem, it's just I'm doing the wrong things.

I tried

$sitedata = include("link.to.file");
echo $sitedata;

That didn't work. What's the right way of getting the data into a php variable so I can begin editing it?

View Replies !
Grouping Like Data While Looping Through Other Data
I have a mysql query that returns quite a bit of data that I need formatted and displayed in a web browser. While I can get each row displayed on it's own with a while loop, I need to group the redundant data while still showing the relevant per line data in each group. Code:

View Replies !
How To Insert Data Into One Form ,the Form Include 2 Table Data In Database
i had create a form and i want to insert the data, but my form was include the data from 2 table , wat will be the query looked like, can somebody give me the example ? How to do it?

View Replies !
Save Form Data - How To Temporarily Store The Form Data Of Page 1
i have separated a form into 3 separate php pages as step 1, step 2 and step 3. i would like to know how to temporarily store the form data of page 1 when the user is moving onto page 3 after completing form 2 on page 2?? then retreive and send the data of all 3 forms together in one email to the webmaster when the user clicks submit on page 3 after completing the 3rd form as well as the previous 2.

View Replies !
Preserving Form Data Prior To Processing The Form Data.
I have a form that will be preserving form data prior to processing
the form data. Upon clicking a certain submit button you will go to
another PHP script that will contain the following code:

View Replies !
Get The Data From Those Rows That Have Data
Hi Guys,
If i were to have the following php query:


$query = "SELECT * FROM alist WHERE list_id = $id";
$result = mysql_query($query);
while($row = mysql_fetch_array($result)){
echo "<b>{$row['List_Name']}</b><BR>";
echo "{$row['address']}, {$row['state']}<BR>{$row['post_code']}<BR>Tel: {$row['phone']}<BR><BR>";
echo "{$row['Info']}<BR>";
echo '</blockquote>'

....how can i get the data from those rows that have data.
For example, some rows won't have a 'phone' value so i don't want this to display "Tel: " if there is no value associated with 'phone'.
What do i need to add to my script inorder to achieve this?

Thanx...

View Replies !
Posting Form Data And Also Allow To Download Form Data
i have a client that whats to post form data to a database but he also wants users of the script to download it aswell how will i got about doing this i thought about it that i could make it save it into a txt file then echo the download link is there any ideas? because to post it to a txt file it would be posting 2 places is there a way to do this? Code:

View Replies !
Switching Mysql Data To Mysql Data?
I've been using wamp5 for about a year or so and I grew tired of it so I uninstalled it and went for a fresh install of apache2, mysql4, php4 and phpmyadmin.

Before I uninstalled WAMP5 I backed up c:wampmysqldata so that I could keep all the database files. My question is, is it safe to just move all of that data into my new mysql installation c:mysqldata ?

I did try this with one small database I had, and I could access it with my new phpmyadmin installation. But I was just wondering if it is an acceptable solution.

View Replies !
Getting Data From The URL.
I´m using php to build dinamyc images. The whole process is done via form. The user enters some data in text fields and them a script retrives this info and builds the image.

The next step is to provide the users with a url so they can display that image in their site. But I need that image to be updated ( if needed ) when it is called to be displayed.

My question is this, how do I get data from the url and use it on my script.

Let me give an example:
The url for the image would be something like:
http://www.myserver.com/images/fabiop.jpg

I need to retrive the username ( fabiop ) and the extension ( .jpg ) and use them in the script to generate the image on the fly to be displayed. How do I acomplished that ?

I´ve seen this working on some sites but I didn´t figure out how it was perform. My best guess was that this sites have a webservice running in the background that performs this action.

View Replies !
Getting The Data To Put Into The New Url
I have a script to select data from a database and put it into a new url which the user gets automaticaly directed to that specific page. The problem is that its not getting the data to put into the new url. Code:

View Replies !
Get Data From Url
how can you get/insert data into a url without using get or post.

for example:

example.com/item/Hot-Bodies-Lightning-2-Sport-RTR-1-8th-Buggy

View Replies !
Data To XML
I am about to build a CMS, but I want to have any data in the database output as XML, so I can use XSLT etc. How do I do this. I don't think that you create dynamic XML files, I think it is just changed on it's way from the database to the browser.

View Replies !
Data Row
I have a php file that performed query statement in an oracle database ver9i which then display records in a table. This php file was created in php ver4 and it was functioning properly. Then php version was changed to php ver5 using the same file but now there are problems displaying the records. The data row is always being displayed twice now??? Any idea why? Is there compatibility issue here?

View Replies !
Sum Data
I have a table with the following fields:
A INT 1
B INT 2
C INT 3
D INT 4
Total INT 3

A through D have 0 or 1 in the field. How can I put the sum of all the 1s into the field TOTAL? for example, if
A = 0
B = 1
C = 1
D = 0

Total should = 2

View Replies !
Trying To Add Data
echo "
<tr>
<td>$name</td>
<td>$desc</td>
<td>
<select name=select>
$i = 0;
while ($i < $total) {
  <option>$i</option>
  $i++;
}
</select>
</td>
</tr>";

it displays the drop down boxes, but with no data, why not?

View Replies !
Getting Data
I have an array like:

Array ( [external-reference] => Array ( [!value] => opengeodb:105 ) [url] => Array ( [!value] => http://www.deutschland.de ) [name] => Array ( [0] => Array ( [!value] => Bundesrepublik Deutschland [!lang] => deu [!begin-year] => 1949 ) [1] => Array ( [!value] => Federal Republic of Germany [!lang] => eng [!begin-year] => 1949 ) ) [type] => Array ( [!value] => 50 ) [!id] => DE [!last-modification] => 2005-09-21T15:42:44.000+02:00 )

and I just want the single output "Bundesrepublik Deutschland " and/ or "Federal Republic of Germany ". I tried all kinds of things, but nothing works.

View Replies !
Sub Data
i want to display the sub data under a header title, hmm i dont really know how to explain that in words. the example should show it clearly:

Title:
sub title1
sub title2
sub title3
sub title4 ...

Title1:
sub title1
sub title2 ...

Title2: ...

and so on. All the title are under main item. How do i extract the datas all from 1 table? and arrange them like above as shown.

View Replies !
CSV Data
Being a newbie, I have run into a wall regarding uploading a csv file into a table. It seems only the first row of each section is successful.

View Replies !
Getting Data From A Txt File
Get data from a txt file, and say that the first 8 characters are the id, the characteres 9 to 17 are the date.

View Replies !
Parse XML Data To PHP
When parsing XML data in a php file the script is told where the data is. For example:

View Replies !
Inserting Data Into A Row
I’ve got a table of three fields (id, name and comments) that contain 30 rows. Each row contains data in the two first fields (an id and a name). The third filed is empty.

When a user accesses my page they can select one of 30 names from a drop down menu. After they’ve selected a name the user can write a comment about the person he/she selected.

How can I insert the comment from the user into the comment field related to the name selected?

View Replies !
Dynamic Data
I have included a php script into my page
as <img src="plot.php">. That script just plot some time changing data. Now I have two questions that I cannot solve myself:

(1) When I press the reload button I expected
the plot reflected the changed data.
Instead of that plot remains unchanged
until I directly invoke the php script
from the browser...
Is there any method to avoid this
unwanted caching?

(2) That is a bit off topic but is there
any easy way to get a web page updating
after a certain period of time?
Once solve my first question I'd like
to offer mi visitors a automatically
changing graphic.

View Replies !
Truncating Data
I have a simple form, going to a simple catch page, but it doesn't work perfectly. In the one text field, it truncates the first 4 characters of the text. The rest of the string comes through fine, but it's the first four that get lost.

this is the top of the form, and the field that is givng me a problem.

View Replies !
Extracting Data From XML ?
The following is the sample XML file from which I want to
extract the data of which availabity ="Available" using php.

The XML file will be generated dynamically from the URL http://www.upc.nl/zipcode.php?zipcode=3565BG

<UPC-Results>
<DateTime>05-12-2005 02:08:26</DateTime>
<Errors/>
<Products>
<Product name="CaTV" availability="NotAvailable"/>
<Product name="Chello Starter" availability="NotAvailable"/>
<Product name="Chello Easy" availability="NotAvailable"/>
<Product name="Chello Light" availability="NotAvailable"/>
<Product name="Digitale telefonie FreeTime" availability="NotAvailable"/>
<Product name="Chello Classic on DSL" availability="Available"/>
<Product name="Chello Plus on DSL" availability="Available"/>
<Product name="Chello Extreme on DSL" availability="Available"/>
<Product name="Digitale telefonie Basis on DSL" availability="Available"/>
<Product name="Digitale telefonie FreeTime on DSL" availability="Available"/>
</Products>
</UPC-Results>
 
from the
above XML, I need to get data of Product name which has the status of
"Available"

View Replies !
Excerpts Of Data
I am working on a project that involves PHP and MYSQL. I am currently pulling information from a TEXT field (could be LONGTEXT). I would like to be able to create an excerpt from the data.

So...say I run this query:

SELECT review FROM bookreview WHERE id=1

That will give me a rather lengthy review. What I would like to do is display only the first X number of words or characters (preferably words), add a ... and then link it to the rest of the story.

My question is how to cut short "review" after X words or characters. I presume it can be done in either PHP or MYSQL but I have no idea how.

I am uncertain if this is important, but this query is going to loop at least several times so I need to be able to work whatever code you give me into a loop so I can pull multiple reviews.

View Replies !
Sort Data
When I click a title of table, I want to sort data. It same phpMyAdmin.

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved