Re: [PHP-DB] Session End
hello, i think you could not realize that with php and sessions. Because you can not read the session from a visitor. or ? Jeroen - Original Message - From: Hayan Al Mamoun [EMAIL PROTECTED] To: PHPList (E-mail) [EMAIL PROTECTED] Sent: Saturday, February 09, 2002 7:52 AM Subject: [PHP-DB] Session End Hi, How can I realize that one session in PHP has been ended, I mean I want a trigger that the visitor of my website, has left ;) Thanks Best Regards Hayan -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Maintain MySQL Transactions
what would you like todo? explain further Jeroen - Original Message - From: Hayan Al Mamoun [EMAIL PROTECTED] To: PHPList (E-mail) [EMAIL PROTECTED] Sent: Saturday, February 09, 2002 7:51 AM Subject: [PHP-DB] Maintain MySQL Transactions Hi, How can I maintain MySQL transactions with PHP Best Regards Hayan -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Oracle 9i support
Theodore D Boardman wrote: Greetings! As far as I can tell from the documentation, the OCI8 driver supports Oracle 8. However, on the ADODB site, they mention that the OCI8 driver supports Oracle 8/9. Can someone clarify what the status of support for Oracle 9i is in PHP? I need to know if I need to stick with Oracle 8i now or not. Ted Boardman Communications Technology Editor Indiana University Alumni Association [EMAIL PROTECTED] http://www.alumni.indiana.edu Hi, As i know there is no problem with oracle 9i - there where some posts about that in php manual in the OCI functions section. Jarry -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Creating temp table with data out of 2 tables possible?
Andy wrote: Hi there, how is it possible to copy rows from more then one table into a temporary table? I have 250 city tables named after the country e.g: ca_cities. Now the user has choosen stuff from lets say ca and gm. I want to collect the data into a temp table and then querry this temp table for other stuff. I always get the error: Error: 1060 Duplicate column name 'id' Here is my statement made for a sample of two tables creating the temporary one ( works with one) $stmt = CREATE TEMPORARY TABLE all_cities SELECT * FROM $DB2.$country_found[0]_cities, $DB2.$country_found[1]_cities ; Does anybody have a clue whats going on here? Thanx for any help Andy try to use coulumn names not * and rename columns Jarek -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: Oracle 9i support
On Sat, Feb 09, 2002 at 01:10:58PM +0100, Jaros?aw Jankowski wrote: Theodore D Boardman wrote: Greetings! As far as I can tell from the documentation, the OCI8 driver supports Oracle 8. However, on the ADODB site, they mention that the OCI8 driver supports Oracle 8/9. Can someone clarify what the status of support for Oracle 9i is in PHP? I need to know if I need to stick with Oracle 8i now or not. Ted Boardman Communications Technology Editor Indiana University Alumni Association [EMAIL PROTECTED] http://www.alumni.indiana.edu Hi, As i know there is no problem with oracle 9i - there where some posts about that in php manual in the OCI functions section. Jarry 9i work fine - we're even going to have scollable cursor support in the oci-driver soon (which requires 9i). tc -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Maintain MySQL Transactions
Unless there has been a very recent development, MySQL doesn't support transactions. Use PostgreSQL, DB, etc. Miles Thompson At 09:51 AM 2/9/2002 +0300, Hayan Al Mamoun wrote: Hi, How can I maintain MySQL transactions with PHP Best Regards Hayan -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re: [PHP-DB] Maintain MySQL Transactions
you must first connect to the mysql database, for example $dbhost = localhost; $dbuser = DATABASE USER; $dbpass = DATABASE PASSWORD; $database = DATABASE NAME; @mysql_connect($dbhost, $dbuser, $dbpass) or die (Deze pagina is tijdelijk offline.); @mysql_select_db($database) or die (Deze pagina is tijdelijk offline.); after the connect you need to query the stuff for example $result = mysql_query(select * from table where id 5); while ($row = mysql_fetch_array($result)) { echo $rij[0]; echo $rij[id]; } /* delete query */' $result = mysql_query(delete from table where id = 1); $nr = mysql_affected_rows($result); echo $nr . rows are deleted.; i hope you have enough info the examples are not tested. Jeroen Timmers. http://www.php.net/manual/en/ref.mysql.php - Original Message - From: Hayan Al Mamoun [EMAIL PROTECTED] To: Jeroen Timmers [EMAIL PROTECTED] Sent: Saturday, February 09, 2002 12:54 PM Subject: Re: Re: [PHP-DB] Maintain MySQL Transactions I have two sql statements, and I want to execute them all or nothing at all. For an example 1- Delete * from sometable where Id=SOMETHING 2- insert into OtherTable (fieldlist) values (valuelist) where Id=SOMETHING. How can I do so? Get your own 800 number Voicemail, fax, email, and a lot more http://www.ureach.com/reg/tag On Sat, 9 Feb 2002, Jeroen Timmers ([EMAIL PROTECTED]) wrote: what would you like todo? explain further Jeroen - Original Message - From: Hayan Al Mamoun [EMAIL PROTECTED] To: PHPList (E-mail) [EMAIL PROTECTED] Sent: Saturday, February 09, 2002 7:51 AM Subject: [PHP-DB] Maintain MySQL Transactions Hi, How can I maintain MySQL transactions with PHP Best Regards Hayan -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Searching records...
What I am doing is user inputs their contact information, then copies and pastes text and also uploads a formal document, which the location is stored in the database. Now, the text that gets pasted into the text field is then stored into the database for search purposes. This is the problem... How would I go about searching this field? I wanted to return all results with the keyword(s)? This is what I came up with the Help of Nicole Amashta. But it doesn't work too hot. I feel I am lost = ? include variables.php; $delimiter = ,; $connection = @mysql_connect($databaseserver, $databaseuser, $databasepass) or die (could not connect to database); $db = @mysql_select_db($databasename, $connection) or die(Could not select database); $sql = SELECT id, FirstName, LastName, Resume, ResumeUp FROM $canidatetable; $result = mysql_query($sql, $connection) or die(Couldn't execute query); while ($row = mysql_fetch_array($result)) { $id = $row['id']; $FirstName = $row['FirstName']; $LastName = $row['LastName']; $filename = $row['Resume']; $ResumeUp = $row['ResumeUp']; $keywords = explode( $delimiter, $words ); for ($i=0; $i count($keywords); $i++) { $kw = $keywords[$i]; if( eregi($kw, $contents) ) { echo The Words b$kw/b has been found in the resume of olli$LastName, $FirstName a href=\http://madden.williamsen.net/recruiter/resumes/$ResumeUp\;Resume/a /li/ol; } else { echo The keyword $kw was not found in the resume $LastName, $FirstNamebr; } } } ? = -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Searching records...
On Sunday 10 February 2002 00:58, Todd Williamsen wrote: What I am doing is user inputs their contact information, then copies and pastes text and also uploads a formal document, which the location is stored in the database. Now, the text that gets pasted into the text field is then stored into the database for search purposes. This is the problem... How would I go about searching this field? I wanted to return all results with the keyword(s)? This is what I came up with the Help of Nicole Amashta. But it doesn't work too hot. I feel I am lost Please elaborate. What does doesn't work too hot mean? Does it work or not? If it doesn't, what's wrong with it? If it does work, why don't you like it? If it makes you feel better, I feel lost as well :) -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* I'd love to go out with you, but I have to floss my cat. */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Maintain MySQL Transactions
On Sunday 10 February 2002 00:21, Miles Thompson wrote: Unless there has been a very recent development, MySQL doesn't support transactions. Use PostgreSQL, DB, etc. The v4 series of MySQL does support transactions. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* Without love intelligence is dangerous; without intelligence love is not enough. -- Ashley Montagu */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] count from the results
On Sunday 10 February 2002 00:55, Barry Rumsey wrote: I have the following code: $query = SELECT * FROM artist WHERE artist LIKE 'b%' ORDER BY artist ASC; [snip] What I would like to know is how do I do a count on each result returned.e.g. Benny(4) , Bill(10) Try: $query = SELECT artist, count(artist) FROM artist WHERE artist LIKE 'b%' ORDER BY artist ASC; -- Jason Wong - Gremlins Associates - www.gremlins.com.hk /* Love is being stupid together. -- Paul Valery */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Resource link errors
Thanks Rick, Now it works. On Thursday 07 February 2002 03:04 pm, Rick Emery wrote: The following means you have not opened a link to your database. Concerntrate your efforts there. Warning: Supplied argument is not a valid MySQL-Link resource in /var/www/html/list.php3 on line 26 -Original Message- From: Ken Thompson [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 07, 2002 3:23 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Resource link errors Hello all, I'm very new to php and have been beating my head on the wall over this for 2 days. I've searched through the php documentation but I guess I either don't know where or what to look for or don't understand what I'm seeing. I think this has to be an array but the original doesn't seem to think so.(see below) I've tried ($myrow = mysql_fetch_array($result)) and still get the same errors. The original that I used as an example works OK showing the results of Name, Position. They didn't include a data cell for $myrow[3] ... = THIS WORKS: ?php $title = Welcome to the Web-Site of; /*I commented this out and finaly removed it cuz I don't want the title echoed in the final page.*/ include(header.inc); $result = mysql_query(SELECT * FROM employees,$db); echo table border=1\n; echo trtdName/tdtdPosition/tr\n; while ($myrow = mysql_fetch_row($result)) { echo(trtd%s %s/tdtd%s/tr\n, $myrow[1], $myrow[2], $myrow[3]); } echo /table\n; include(footer.inc); ? === What I am trying to do is to return the results of the query into a table with these items: +---+-+--+-+-++ | Field | Type| Null | Key | Default | Extra | +---+-+--+-+-++ | id| tinyint(4) | | PRI | NULL| auto_increment | | year | int(4) | YES | | NULL|| | make | varchar(20) | YES | | NULL|| | model | varchar(20) | YES | | NULL|| | engine| varchar(20) | YES | | NULL|| | fuel | varchar(8) | YES | | NULL|| | trans | varchar(10) | YES | | NULL|| | condition | varchar(20) | YES | | NULL|| | price | varchar(10) | YES | | 0 || | location | varchar(20) | YES | | NULL|| +---+-+--+-+-++ These are the errors that show up when I run the page in the browser. The database is local and I'm on Linux-Mandrake 8.1 using Apache web server. I can get the results I want from the command line, that is I can make queries and get the proper info returned. what have I done to cause it not to work? Warning: Supplied argument is not a valid MySQL-Link resource in /var/www/html/list.php3 on line 26 Warning: Supplied argument is not a valid MySQL result resource in /var/www/html/list.php3 on line 32 THIS DOESN'T: I get the table and the item name e.g. Year, Make etc. Once I get the 3 cells returning the proper info, I want to add the rest of the cells needed to display all the info in the web page. I don't think it should be a problem, comments on this? ?php include(header.inc); //(Line 26 below, everything above ?php is plain html.) $result = mysql_query(SELECT * FROM autos,$db); echo table border=1\n; echo trtdYear/tdtdMake/tdtdModel/td/tr\n; //(Line 32 below) while ($myrow = mysql_fetch_row($result)) { //What does the '%s' mean? I read it someplace in the tutorial //but can't find it now. printf(trtd%s %s/tdtd%s/tr\n, $myrow[1], $myrow[2], $myrow[3]); } echo /table\n; include(footer.inc); ? -- Ken Thompson, North West Antique Autos Payette, Idaho Email: [EMAIL PROTECTED] http://www.nwaa.com Sales and brokering of antique autos and parts. Linux- Coming Soon To A Desktop Near You Registered Linux User #183936 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: count from the results
Hi Barry! you can do it like this for example: $query = SELECT * FROM artist WHERE artist_name LIKE 'b%' ORDER BY artist ASC; $count = mysql_query(SELECT COUNT(artist) AS count FROM artist WHERE artist_name LIKE 'b%',$db); $x = mysql_fetch_array($count); $result = mysql_query($query) or die(Select Failed!); $number = $x[count]; echo h3Total Number Of Artists In \B\:nbsp;nbsp;; echo $number; echo brbr/h3; if (mysql_num_rows($result)) { echo table; echo trthArtists/th; while ($qry = mysql_fetch_array($result)){ echo tr; echo td; echo $qry[artist]; }}? Barry Rumsey [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]... I have the following code: $query = SELECT * FROM artist WHERE artist LIKE 'b%' ORDER BY artist ASC; $result = mysql_query($query) or die(Select Failed!); echo h3Total Number Of Artists In \B\:nbsp;nbsp;; echo mysql_num_rows($result); echo brbr/h3; if (mysql_num_rows($result)) { echo table; echo trthArtists/th; while ($qry = mysql_fetch_array($result)){ echo tr; echo td; echo $qry[artist]; }}? What I would like to know is how do I do a count on each result returned.e.g. Benny(4) , Bill(10) -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Maintain MySQL Transactions
At 2:00 +0800 2/10/02, Jason Wong wrote: On Sunday 10 February 2002 00:21, Miles Thompson wrote: Unless there has been a very recent development, MySQL doesn't support transactions. Use PostgreSQL, DB, etc. The v4 series of MySQL does support transactions. MySQL has supported transactions since version 3.23.17. At that time BDB tables were the only transaction-capable type. InnoDB tables were added in version 3.23.34a. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: option in forms
I think this is what you're getting at: select name=artistID option value=?= $row[ID] ??= $row[ArtistName] ?/option /select or something like that so it would look like (in HTML) select name=artistID option value=23Artist's Name First in list/option option value=44Artist's Name second in list/option option value=105Artist's Name third in list/option /select if you select the first item in the list, the next page will produce: $artistID = 23 so yah... thats it ---____-_--_-_-_-_-___-___--_-_-_-_-- I know how to do the option call e.g. This is the list of artists already in our database : SELECT name=artist ?php echo $option_block; ? /SELECT But I want to do a form where they select the option then fill out rest of form. The option above returns the artist name, but I want to insert the artistid. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Outputing Distinct rows
I'll give you all the short version of what I need and if it is enough for you to help that would be great. I need to pull the last 10 updated topics from a table and output them. However, the posts table lists each post and then has a topic id. There is also a table of topics with topic id, title, etc. I cannot just pull the last 10 posts in the post table because those posts could all be for the same topic and I'm trying to output the last 10 updated topics (not posts). How can I do this? I can't find anything on the subject. This is what I tried as a random guess: $sql = SELECT DISTINCT posts.topic_id, posts.forum_id, topics.topic_title, topics.topic_replies WHERE topics.topic_id = posts.topic_id DESC LIMIT 10; Any ideas about what I need to do? I'm sure it is pretty simple. Regards, Steve KingZeus Downs Co-Webmaster: http://www.cncrenegade.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] PHP MySQL and updating
Hi again, I am having trouble with updating. How do I tell php to update the database at mid night instead of every time the browser is refreshed? I have looked for it but can't find the info. Also I thought session ID's were different between users. Is this true? Thanks Jennifer Downey -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php