[PHP-DB] Re: Storing browser stats

2003-03-06 Thread Joel Colombo
at the top of the page.. i assume MYSQL DB. you must establish $link_id first connect to your DB then run. remember if u use this code a function, remember $HTTP is not global by default. $browser = $HTTP_SERVER_VARS["HTTP_USER_AGENT"]; $sql = "INSERT INTO table (useragent_name) VALUES

[PHP-DB] mysql - first element missing

2003-03-06 Thread f.collineau
Hi, I try to display the result of a mysql request but first element misses ! here is my code: $sql->Query("select marque, reference from base ); $sql->afficheResultatRequete($sql->result,$sql->nbreChamps); function Query ($query) { $this->result = @mysql_query($query, $this->id) or MyS

[PHP-DB] Playing mp3s using flash and php

2003-03-06 Thread James Riley
Hi there, Im currently working on a teaching system for the Uni of Vienna. I have a problem though. We have over 2000 sound files (mp3s) of phrases and words. But students are having problems playing them because of different configuration setups. At the moment they need flash for certain tasks,

Re: [PHP-DB] Playing mp3s using flash and php

2003-03-06 Thread heilo
Hi! I am currently working on a shop system, which works with flashmx and php and uses a mysql-database to read the path of the protected mp3s and so the mp3s are passed to the flashmovie through php using the file-functions. The shop also reads out the directories and parses the xml-output of the

[PHP-DB] Populate Array During Loop With in_array

2003-03-06 Thread Hutchins, Richard
Can somebody please tell me why the $displayThese variable in the code snippet below only gets populated with the last value in the $newsList array even when $newsList has more than one row of data? while($newsList = mysql_fetch_array($result_getNews)){ if(

[PHP-DB] mysql statement: two tables, two comparisons

2003-03-06 Thread Jason End
I'm looking for a mysql select statement that does the following: - Check if the value of each expert.id on the table experts matches a value expt.id in the table apliexpert. - For those values where this is true check whether the softID value for that row matches the variable $softId. - return th

RE: [PHP-DB] Populate Array During Loop With in_array

2003-03-06 Thread Rich Gray
> Can somebody please tell me why the $displayThese variable in the code > snippet below only gets populated with the last value in the > $newsList array > even when $newsList has more than one row of data? > > while($newsList = mysql_fetch_array($result_getNews)){ >

RE: [PHP-DB] Storing browser stats

2003-03-06 Thread Matthew Moldvan
I would say use JavaScript to gather the information (screen resolution, browser info, etc) and then store it in a MySQL or similar DB using PHP. Do a search for JavaScript and PHP variables to find out how (it involves populating hidden fields with JS and passing to PHP Scripts AFAIK) ... that sh

RE: [PHP-DB] Storing browser stats

2003-03-06 Thread Mignon Hunter
This will work except for those browsers with javascript turned off - I've seen php examples of how to do this in books, (capture the user agent anyway, then once captured - just plop it in the db) there should be some on line somewhere. Also if you have access to the web server, I think most w

RE: [PHP-DB] mysql statement: two tables, two comparisons

2003-03-06 Thread Beverly Steiner
J, Try this (it assumes that the softid you want to search for is in the variable $softid): $sql = "SELECT Expert.* FROM Expert LEFT JOIN Apliexpert ON Expert.id = Apliexpert.exptid WHERE Apliexpert.softid = '$softid' ORDER BY Expert.Name"; --

[PHP-DB] images - BINARY -> HTML

2003-03-06 Thread Dallas Freeman
Hey, Just something easy, using a MySQL database, I don't know how to convert Binary to a image file to be placed into html. Could someone please help. Thanks Dallas Freeman

RE: [PHP-DB] Populate Array During Loop With in_array

2003-03-06 Thread Hutchins, Richard
Rich, Thanks! You pointed me in the right direction and I now have the code working and returning the expected results. If anybody's interested, just post back to the list and I'll post the working code. Don't want to bog the list down if nobody cares. Rich > -Original Message- > From: R

RE: [PHP-DB] Populate Array During Loop With in_array

2003-03-06 Thread Jeffrey_N_Dyke
personally, i think solutions are always worthwhile, no matter how trivial. that way when someone is searching the archives, they will find the solution in the thread. just my $.02 Jeff

[PHP-DB] Array & loops

2003-03-06 Thread Robin Sanchez
I am creating a results page for completed and uncompleted procedures. I am repeating a lot of the code and wonder if there is an easier way to do this. $neh="select * from pro_list, complete_pro where pro_list.pro_name ='Neurological Exam/History' and complete_pro.proid=pro_list.proid and complet

RE: [PHP-DB] Populate Array During Loop With in_array

2003-03-06 Thread Hutchins, Richard
OK, so here's the solution I came up with. A little harder to read here than in an editor, but it's as clean and tight as I could make it. I use it as the body of a function that returns $displayThese to a script uses the newsID values to display those news items that have not expired AND the user

RE: [PHP-DB] Populate Array During Loop With in_array - FIXED

2003-03-06 Thread Hutchins, Richard
Really have to apologize. I tested the previous code too hastily before I posted it, and additional testing after I posted it proved that it broke with multiple items marked as read. Here is the fixed code. Hopefully I've plugged the holes. Sorry for any inconvenience to anybody actually paying att

RE: [PHP-DB] Storing browser stats

2003-03-06 Thread Mark
There is some information you can from the browser, and some you cannot. Check out http://www.php.net/manual/en/reserved.variables.php#reserved.variables.server for stuff the server is/can be aware of. Beyond that info, you'd have to use something client side, like JavaScript. For those users that

[PHP-DB] How to page results?

2003-03-06 Thread mike karthauser
We've been working on a news section for our site which allows us to find news stories -> dump them in a mysql db, list the summaries in a page and then link to a full version of the story. The bit i'm having trouble with is how to list the results so we can set up multi pages of content and link

RE: [PHP-DB] How to page results?

2003-03-06 Thread Hutchins, Richard
Mike, If you check www.phpclasses.org, and search for "paging" there's a paging class built by pierre-yves lemaire that might do just what you're looking for. It's pretty highly rated by the users of the site. I also know this question has been asked in the past so a stroll through the archives m

[PHP-DB] Re: Array & loops

2003-03-06 Thread Joel Colombo
Hi there. here ya go. $array_of_exams = Array(); $array_of_exams['Full Head'] = 'Head Examination History'; $array_of_exams['Full Body'] = 'Body Examination History'; $array_of_exams['Full Butt'] = 'Butt Examination History'; $exam_dates = Array(); foreach ($array_of_exams as $exam => $description

Re: [PHP-DB] Catalogue system? there was : Mysql compress text field?

2003-03-06 Thread Patricio Vera S.
Hi!, Do you have other ideas about how do it? I thinking do : 1. Save the report in a MMDD// tree directory structure. 2. Save in the database the information about the report, and the path to the page directory. 3. When the user request a report I go to the path and

[PHP-DB] Re: Array & loops

2003-03-06 Thread Robin Sanchez
Thanks that works like a charm and I learned some tricks that I can apply to some other code!!! Ozzie Hi there. here ya go. $array_of_exams = Array(); $array_of_exams['Full Head'] = 'Head Examination History'; $array_of_exams['Full Body'] = 'Body Examination History'; $array_of_exams['Full Butt'

[PHP-DB] Store

2003-03-06 Thread Marie Osypian
I was wondering if anyone was using a good store that was open sourced in php. Marie O -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP-DB] Store

2003-03-06 Thread Aaron Wolski
Mine :) Aaron -Original Message- From: Marie Osypian [mailto:[EMAIL PROTECTED] Sent: March 6, 2003 2:53 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Store I was wondering if anyone was using a good store that was open sourced in php. Marie O -- PHP Database Mailing List (http://www.p

[PHP-DB] Subtraction of two units of time.

2003-03-06 Thread David Rice
I want to take away two times stored in the format "00:00:00" in a mysql database, i retrieve the times and take them away by using the following $total = $time1 - $time2 ; when i echo the total it is a whole number of the hours.. and does not take the minutes into account, anyone have an ide

Re: [PHP-DB] Subtraction of two units of time.

2003-03-06 Thread Peter Beckman
$foo = split(":",$time1); $bar = split(":",$time2); $time1 = mktime($foo[0],$foo[1],$foo[2],1,1,1980); $time2 = mktime($bar[0],$bar[1],$bar[2],1,1,1980); $total = $time1 - $time2; That will give you the difference in seconds between the two. I'll let you convert it to hh:mm:ss. Peter On Thu,

Re: [PHP-DB] Subtraction of two units of time.

2003-03-06 Thread 1LT John W. Holmes
> I want to take away two times stored in the format "00:00:00" in a mysql > database, i retrieve the times and take them away by using the following > > $total = $time1 - $time2 ; > > when i echo the total it is a whole number of the hours.. and does not take > the minutes into account, anyone hav

[PHP-DB] retrieve last n records

2003-03-06 Thread drparker
I need to retrieve the last n records of a table, n will probably be 2 or 3. I know that I can accomplish this by: select * from table order by field DESC Limit n, but i would prefer not to do this way because it interferes with my sorting mechanism on the main page. Is there any other way to do

[PHP-DB] query that finds when something is NOT IN a table

2003-03-06 Thread Katie Evans-Young
(Using MySQL and PHP) I need to only return a row from table1 if its id is not found in table2. The query below is how I think it should work. However (as I had imagined), this doesn't work. Syntax error (you can't put a select inside a select like that). SELECT table1.id FROM table1 WHERE table1

Re: [PHP-DB] retrieve last n records

2003-03-06 Thread Jim Hunter
I guess I am confused, how does one query effect a query that you have in an other part of the page? The two queries are not related. The second thing I am confused on is: Do you want the last n records that were added to the table or do you want the last n records in a given index? Jim ---

[PHP-DB] images - BINARY -> HTML

2003-03-06 Thread Dallas Freeman
Please ignore my previous email, I figured out how. Thanks anyways. -Original Message- From: Dallas Freeman [mailto:[EMAIL PROTECTED] Sent: Friday, 7 March 2003 1:51 AM To: '[EMAIL PROTECTED]' Subject: images - BINARY -> HTML Hey, Just something easy, using a MySQL databa

[PHP-DB] file save

2003-03-06 Thread Ryan Holowaychuk
I am saving some data to a text file and what I want to do is have each line of data collected to be on its own line. What I am collecting is a roster (no, name, grade) so there is 10-15 people on a roster, and now when it saves it saves to one line. Thanks Ryan -- PHP Database Mailing Li

Re: [PHP-DB] retrieve last n records

2003-03-06 Thread drparker
I need the last n records when, say user_id = 3. So it returns all rows where user_id = 3, then, on top of that I need only the n most recently entered records. The problem with the sorting mechanism I have existing is essentially that those last n rows need to be sorted ASC or DESC by every fie

Re: [PHP-DB] retrieve last n records

2003-03-06 Thread Jim Hunter
If it were me I would tackle this in two parts. First create a SQL statement that returns the data you want, you say you can do this so the first part is already finished. Then stuff the data into an array and when you go to display the data to the user, that is when you sort it into the chosen sor

Re: [PHP-DB] query that finds when something is NOT IN a table

2003-03-06 Thread Paul Burney
on 3/6/03 4:59 PM, Katie Evans-Young at [EMAIL PROTECTED] appended the following bits to my mbox: > I need to only return a row from table1 if its id is not found in table2. > The query below is how I think it should work. However (as I had imagined), > this doesn't work. Syntax error (you can't p

[PHP-DB] Re: file save

2003-03-06 Thread Fredrik de Vibe
[EMAIL PROTECTED] (Ryan Holowaychuk) writes: > I am saving some data to a text file and what I want to do is have each > line of data collected to be on its own line. > > What I am collecting is a roster (no, name, grade) so there is 10-15 > people on a roster, and now when it saves it saves t

Re: [PHP-DB] retrieve last n records

2003-03-06 Thread Doug Parker
OK, I would like to do it with the method you suggested. However, I'm having a few problems. Firstly, I can't seem to figure out how to sort rows returned from mysql_fetch_array. sort() or any other array function won't work because each row is an array, and I need to sort by the column. Se

[PHP-DB] Need help with php and apache

2003-03-06 Thread Stephen K Knight
I am currently running on a Windows Box the OS is ME I have installed apache 2.0.44 and I have downloaded the newest PHP download for windows. I have read the configuration manual repeatedly for getting the php into the apache httpd.conf doc file. but I still cannot get php to be recognized. Can a

[PHP-DB] I need some help with php code please

2003-03-06 Thread Stephen K Knight
I am trying to upload an image to my webserver. This is the PHP page that is called from my html page. I am trying to upload the image to my folder called "logos" the direct link would be: C:\Program Files\Apache Group\Apache2\htdocs\logos I am not sure what I am doing wrong in the code below.

[PHP-DB] data insert in textfile

2003-03-06 Thread Ramesh PAtel
Sir, I am working on PHP and PostgreSQL. I want to insert output of my Query in textfile. so how to open file and insert data one by one in textfile. please help me. Ramesh Patel [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/un

[PHP-DB] Persist Db Connection Why ??

2003-03-06 Thread Aspire Something
Hi all, Permit to recive your valuable knowledege :) I would like to know that what good does Persist connection to a database do i.e, 1. Will it increse the performance (My DB and Apache are on same Machine) 2. Can a pErsist connection be Broken after the job has been done as we have 32 limite

Re: [PHP-DB] data insert in textfile

2003-03-06 Thread Jason Wong
On Friday 07 March 2003 13:59, Ramesh PAtel wrote: > I am working on PHP and PostgreSQL. > > I want to insert output of my Query in textfile. > so how to open file and insert data one by one in textfile. fwrite(), see manual for details and example. -- Jason Wong -> Gremlins Associates -> www.

Re: [PHP-DB] Help with a query

2003-03-06 Thread Corne' Cornelius
Why not use: SELECT a.item_id, a.subtotal, a.quantity FROM shopping_cart a, orders b WHERE b.session_id = session_id() AND b.customer_id = $customer_id AND a.order_id = b.border_id ? !Exclude Disclaimer! Jonathan Villa wrote: >I can't figure this query out. > >I want to pull data from