[PHP] PATH_INFO at document root
Hi all, I want to set up one virtual server with many domains pointing to it which serves pages depending on the domain name. Here is how i see it: 1) 3 domains pointing to 1 virtual server, eg. www.foo.com www.bar.com and www.blah.com 2) If user visits http://www.foo.com/contact.phtml then the PHP script does this: So the question is, how do i get one script called no matter what comes after the root slash, and pass that info to the script? Cheers Simon Kimber -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] All URL's calling one script
Hi All This is possibly more of an apache/linux question... does anyone know a way to force ANY url to run ONE PHP script on a virtual server... eg. the same script is run if a user goes to www.myserver.co.uk or www.myserver.co.uk/dfkgjdfl/ or www.myserver.co.uk/hello.htm or WHATEVER!!! :o) Cheers Simon Kimber Funny.co.uk - The Comedy Portal http://www.funny.co.uk/ Now Incorporating: The UK Live Comedy Directory FREE promotion for UK Comedy Acts and Venues http://www.funny.co.uk/uklive/ eml. [EMAIL PROTECTED] icq. 16156911 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Multipe Tables, Single Query Problem
Hi all, I have three tables in my (mysql) database: videos - ID, title, description, etc.. links - ID, videoID, actorID actors - ID, name, dateofbirth, gender, etc... what i need to do is return a particular video and all it's staring actors with just one query returning just one row, ie. with all the actor names in one field... is this possible? or do i have to get the video data first and then the actors separately? Simon Kimber Funny.co.uk - The Comedy Portal http://www.funny.co.uk/ Now Incorporating: The UK Live Comedy Directory FREE promotion for UK Comedy Acts and Venues http://www.funny.co.uk/uklive/ eml. [EMAIL PROTECTED] icq. 16156911
RE: [PHP] Multipe Tables, Single Query Problem
Christopher Wrote... > You need to be able to tie at least one field from each table to > one other > field in another table, and then you can have a query like: > > SELECT videos.*, links.*, actors.* > FROM videos, links, actors > WHERE videos.VideoID = '$VideoID' AND > links.VideoID = videos.VideoID > actors.ActorID = links.ActorID > Thanks Christopher, but wouldn't this return a separate row for each actor? I'm pretty sure i need something more than a simple join :o( Here's my original question again: "what i need to do is return a particular video and all it's staring actors with just one query returning just one row, ie. with all the actor names in one field" Ray Wrote... > Something like: > > SELECT name, title, description from videos, actors, links where > actors.ID = links.ID and videos.ID=videoID, and videos.ID = 20; ? > > But in just want one row? You could return all the names in one row (I > think) using MySQL (I assume?) string functions... I have a funny > feeling you need a sub select, which mysql doesnt support... > Ray, I have a funny feeling you could be right :o( Cheers Simon Kimber Funny.co.uk - The Comedy Portal http://www.funny.co.uk/ Now Incorporating: The UK Live Comedy Directory FREE promotion for UK Comedy Acts and Venues http://www.funny.co.uk/uklive/ eml. [EMAIL PROTECTED] icq. 16156911
[PHP] MySQL problem
Hi All, Does anyone know if this can be done with one query? I have to create a chart based on info in two tables that are four tables apart. Here are the relevant tables and just the most relevant fields... accident_report - ID - weekending (this is a -MM-DD format date) - (and others) accident_data - ID - accident_report_id - (and others) accident_cause (a lookup table) - ID - accident_data_id - cause_id cause (a list of possible causes of accidents ie. "falling object" or "electric shock" - ID - Description I need to list all the causes with the number of times each has occurred, even if it's zero times... they don't need to be listed in any particular order... Cheers Simon Kimber -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] MySQL problem
Sorry!!! I'm stupid! I forgot to mention that the list of causes has to be for a specified accident_report.weekending Cheers Simon > -Original Message- > From: Don Read [mailto:[EMAIL PROTECTED]] > Sent: 04 July 2001 23:21 > To: Simon Kimber > Cc: [EMAIL PROTECTED] > Subject: RE: [PHP] MySQL problem > > > > On 04-Jul-01 Simon Kimber wrote: > > Hi All, > > > > Does anyone know if this can be done with one query? > > > > I have to create a chart based on info in two tables that are > four tables > > apart. > > > > Here are the relevant tables and just the most relevant fields... > > > > accident_report > > - ID > > - weekending (this is a -MM-DD format date) > > - (and others) > > > > accident_data > > - ID > > - accident_report_id > > - (and others) > > > > accident_cause (a lookup table) > > - ID > > - accident_data_id > > - cause_id > > > > cause (a list of possible causes of accidents ie. "falling object" or > > "electric shock" > > - ID > > - Description > > > > > > I need to list all the causes with the number of times each has > occurred, > > even if it's zero times... they don't need to be listed in any > particular > > order... > > > > "select cause.ID, count(*) as cnt from ... > WHERE ... > group by cause.ID"; > > Regards, > -- > Don Read [EMAIL PROTECTED] > -- It's always darkest before the dawn. So if you are going to >steal the neighbor's newspaper, that's the time to do it. > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] MySQL error... but it works!!??
Does anyone have any idea why this is giving me a "Warning: Supplied argument is not a valid MySQL result resource in..." error? The funny thing is that apart from that error message it works perfectly!! --- $crdate = date("Y-m-d"); $result = mysql_query("SELECT * FROM sites WHERE creation_date = '$crdate' AND status = 'T'"); while ($sitedata = mysql_fetch_array($result)) { echo $sitedata['name'] . ""; } --- Cheers Simon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Is CRON'd PHP script already running?
Hi All, I have a PHP script that i want to run every few minutes (via cron) but I only want it to run if it isn't already running. Is there something in cron itself to solve this or is there a way within PHP to detect that another instance of the current script is running and if so exit the new instance before it does anything... eg. I could have a function to use like so: if (already_running($SCRIPT_NAME)) { exit(); } Thanks in advance! Simon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Is CRON'd PHP script already running?
How do i do that exactly? Cheers Simon -Original Message- From: Richard Heyes [mailto:[EMAIL PROTECTED]] Sent: 20 September 2001 18:38 To: [EMAIL PROTECTED] Subject: RE: [PHP] Is CRON'd PHP script already running? > ...in perl > check to see > if the process is already running, and if so exit... Or just do this at the top of the cron'ed php script. -- Richard Heyes "I know not with what weapons World War III will be fought, but World War IV will be fought with sticks and stones." - Albert Einstein -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] How do i retrieve the records that are NOT linked?
Hi All, Are there any MySQL "gurus" who can help me solve this problem? I have three tables... users, categories and category_user_rights "categories" contains: ID, parent_ID, name "users" contains: username, password, name, etc "category_user_rights" contains: username, category_ID How do I pull everything out of "categories" that a given user DOES NOT have rights to? ie. every record from "categories" that does not have a record in "category_user_rights" linking it to a username such as "fred" Any help on this would be greatly appreciated! Thanks! Simon Kimber -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] How do i retrieve the records that are NOT linked?
> if i understand you correctly, perhaps this: > > select * from categories a,category_user_rights b where a.name!=b.username; > > jack When i do something like that I get loads of duplicate records including the ones that should be there! so if i do a group the result just looks like i've selected everything... here's my query for getting all the (sub)categories that DO have an entry in "category_user_rights"... Somehow i need to reverse it to pull out everything but what it's returning at the moment! :o( $sql = "SELECT categories.ID, categories.title, categories.code "; $sql .= "FROM categories, category_user_rights "; $sql .= "WHERE categories.parentcat_INC = $cat "; $sql .= "AND categories.ID = category_user_rights.category_id "; $sql .= "AND category_user_rights.username = '$username'"; $result = mysql_query($sql); Original message: "categories" contains: ID, parent_ID, name "users" contains: username, password, name, etc "category_user_rights" contains: username, category_ID How do I pull everything out of "categories" that a given user DOES NOT have rights to? ie. every record from "categories" that does not have a record in "category_user_rights" linking it to a username such as "fred" Any help on this would be greatly appreciated! Thanks! Simon Kimber -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Finding the records that are NOT linked
Hi all, I have written a PHP/MySQL "top-sites" program. It has two tables, link_sites, which contains the details of all the sites signed up (ID,url,title,description) and link_stats in which a new record is inserted every time a visitor links in from one of those sites (ID,siteID,clientIP,datestamp). Can anyone help me write a SQL query to pull out all the sites in link_sites that are not mentioned in link_stats.. ie the ones that have never been clicked.. Cheers Simon Kimber Funny.co.uk - The Comedy Portal http://www.funny.co.uk/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]