[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 (\$browser\);
mysql_query($sql, $link_id);

Simple as that
Joel Colombo




Bruce Levick [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Is there a method for storing each users browser stats within a database
table.

So everytime someone visits the browser info is gathered and stored as a
unique row in the 'browser' table in the database.

Any advice??

Cheers



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[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 MySQL_ErrorMsg (Impossible
de lancer la requete: $query);
$this-rows = @mysql_num_rows($this-result);
$this-nbreChamps = @mysql_num_fields($this-result);
$this-ligne = @mysql_fetch_row($this-result);
}


function afficheResultatRequete($result,$nbChamps)
{
for($i=0 ; $row=mysql_fetch_row($result);++$i)
{
print(tr);
$this-color_tab($i);
for($j=0;$j$nbChamps;$j++)
{
print td; print((string)$row[$j]); /td\n;
}
print /tr;
}

}

Whet is the problem ?

Thanks

Franck
--

Faites un voeu et puis Voila ! www.voila.fr 



--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[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, so it would make sense to
play the sound through a small flash movie - as they will have the plug-in-
I am working with Flash MX, but I cant seem to get a movie to get the
address of the mp3 from the database, and then play it.

It would be perfect if I had a solution of 1 Flash movie/PHP script which
can pull in the sound link and play the file. This same movie would be
used throughout the site.

Any help would be brilliant

Thanks a lot

James Riley



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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-file so that one can choose the files in the flash-movie. I think with a
little work and user-distinguishing it would be possible to create private
playlists.

You can see the shop on http://www.help-music.at/cms_global.php?id=18 (but
its not finished yet...) If you are interested in the fla mail me under
[EMAIL PROTECTED]

- matthias steinböck

James Riley [EMAIL PROTECTED] [EMAIL PROTECTED] 13:45 Uhr:

 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, so it would make sense to
 play the sound through a small flash movie - as they will have the plug-in-
 I am working with Flash MX, but I cant seem to get a movie to get the
 address of the mp3 from the database, and then play it.
 
 It would be perfect if I had a solution of 1 Flash movie/PHP script which
 can pull in the sound link and play the file. This same movie would be
 used throughout the site.
 
 Any help would be brilliant
 
 Thanks a lot
 
 James Riley
 
 


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[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($convReadList != ){
for($i = 0; $i  $countNewsItems; $i++){
if (!in_array($newsList[$i],
$convReadList)){
//echo $newsList[$i]. was
found\n;
$displayThese[$i] =
$newsList[$i];
}
}
}
else{
echo preadList is empty/p;
}
}
print_r($displayThese);

$result_getNews is a small associative array of news article IDs drawn from
a MySQL db query. I know it has more than one row because I can print_r it
and see the data in the array. Furthermore, the echo... line below, the loop
prints out the IDs I expect to see. However, when I attempt to put them into
the $displayThese array, I only get the last news article ID in the result
set.

If the my $result_getNews variable holds an associative array
([0]=2,[1]=4,[2]=6) and $convReadList is ([0]=4) then the following
output is produced:

2 was found6 was found

but print_r($displayThese) produces Array([0]=6) which is the last result
in the $resultGetNews set.

I have echoed and print_r() -ed every single variable to check its contents
and they all contain exactly what I expect them too up until that last
print_r($displayThese).

Is this related to the way in_array works, to the way an associative array
works or am I not populating the $displayThese array properly? Or have I
just been staring at this same code for way too long and am missing
something obvious?

Help is appreciated.

Thanks,
Rich


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[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 the names that are left after those 2 filters

So for tables:

Expert
idName
1Peter
2Paul 
3Mary
4Frank

Apliexpert
exptid  softid
1   3
2   5
2   8
3   9
3   8

1. If the softID is 2, the select should return:
peter, paul, mary and frank (frank will always be
returned no matter what, because he isn't in
apliexpert)
2. If the softID is 3, the select should return: paul,
mary and frank
3. If the softID is 8, the select should return: peter
and frank
4. If the softID is 9, the select should return:
peter, paul and frank

J

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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)){
   if($convReadList != ){
   for($i = 0; $i  $countNewsItems; $i++){
   if (!in_array($newsList[$i],
 $convReadList)){
   //echo $newsList[$i]. was
 found\n;
   $displayThese[$i] =
 $newsList[$i];
   }
   }
   }
   else{
   echo preadList is empty/p;
   }
   }
   print_r($displayThese);



You're resetting $i back to 0 for each row returned from the database. So if
there are multiple rows (which you say there are) then the array entries
will get overwritten each time...

HTH
Rich


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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
should get you started, at least. :)

Good luck, and for curiosities sake let me know how the project turns out.

Regards,
Matthew Moldvan

---
 System Administrator
 Trilogy International, Inc
  http://www.trilogyintl.com/ecommerce/
--- 


-Original Message-
From: Bruce Levick [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 05, 2003 6:26 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Storing browser stats


Is there a method for storing each users browser stats within a database
table.

So everytime someone visits the browser info is gathered and stored as a
unique row in the 'browser' table in the database.

Any advice??

Cheers

-- 
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] 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 web server stat
programs allow for this.  The one we use is http://www.analog.cx/ and we
have it configured to capture user agents.

mignon

On Thu, 2003-03-06 at 08:58, Matthew Moldvan wrote:
 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
 should get you started, at least. :)
 
 Good luck, and for curiosities sake let me know how the project turns out.
 
 Regards,
 Matthew Moldvan
 
 ---
  System Administrator
  Trilogy International, Inc
   http://www.trilogyintl.com/ecommerce/
 --- 
 
 
 -Original Message-
 From: Bruce Levick [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, March 05, 2003 6:26 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Storing browser stats
 
 
 Is there a method for storing each users browser stats within a database
 table.
 
 So everytime someone visits the browser info is gathered and stored as a
 unique row in the 'browser' table in the database.
 
 Any advice??
 
 Cheers
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
-- 
Mignon Hunter
Web Developer
Toshiba International
713.466.0277 x 3461


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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;

--
Beverly Steiner
[EMAIL PROTECTED]



-Original Message-
From: Jason End [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 06, 2003 8:52 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] mysql statement: two tables, two comparisons


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 the names that are left after those 2 filters

So for tables:

Expert
idName
1Peter
2Paul
3Mary
4Frank

Apliexpert
exptid  softid
1   3
2   5
2   8
3   9
3   8

1. If the softID is 2, the select should return:
peter, paul, mary and frank (frank will always be
returned no matter what, because he isn't in
apliexpert)
2. If the softID is 3, the select should return: paul,
mary and frank
3. If the softID is 8, the select should return: peter
and frank
4. If the softID is 9, the select should return:
peter, paul and frank

J

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

--
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] 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: Rich Gray [mailto:[EMAIL PROTECTED]
 Sent: Thursday, March 06, 2003 10:05 AM
 To: Hutchins, Richard; [EMAIL PROTECTED]
 Subject: RE: [PHP-DB] Populate Array During Loop With in_array
 
 
  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($convReadList != ){
  for($i = 0; $i  $countNewsItems; $i++){
  if (!in_array($newsList[$i],
  $convReadList)){
  //echo 
 $newsList[$i]. was
  found\n;
  $displayThese[$i] =
  $newsList[$i];
  }
  }
  }
  else{
  echo preadList is empty/p;
  }
  }
  print_r($displayThese);
 
 
 
 You're resetting $i back to 0 for each row returned from the 
 database. So if
 there are multiple rows (which you say there are) then the 
 array entries
 will get overwritten each time...
 
 HTH
 Rich
 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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


   
  
Hutchins, Richard
  
[EMAIL PROTECTED]   To: [EMAIL PROTECTED] 
  
geusa.comcc:  
  
  Subject: RE: [PHP-DB] Populate 
Array During Loop With in_array 
03/06/2003 11:33 AM
  
   
  
   
  




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: Rich Gray [mailto:[EMAIL PROTECTED]
 Sent: Thursday, March 06, 2003 10:05 AM
 To: Hutchins, Richard; [EMAIL PROTECTED]
 Subject: RE: [PHP-DB] Populate Array During Loop With in_array


  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($convReadList != ){
  for($i = 0; $i  $countNewsItems; $i++){
   if (!in_array($newsList[$i],
  $convReadList)){
//echo
 $newsList[$i]. was
  found\n;
$displayThese[$i] =
  $newsList[$i];
   }
  }
 }
 else{
  echo preadList is empty/p;
 }
}
print_r($displayThese);
 
 

 You're resetting $i back to 0 for each row returned from the
 database. So if
 there are multiple rows (which you say there are) then the
 array entries
 will get overwritten each time...

 HTH
 Rich


--
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] 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 complete_pro.sysid='$sysid'
and complete_pro.transid='$transid';
$resneh=safe_query($neh);
while ($rown=mysql_fetch_array($resneh)){
$compl_date1=$rown['compl_date'];
}
echo p1. Neurological Exam and History $compl_date1;

$neh=select * from pro_list, complete_pro where pro_list.pro_name ='Ankle
Arm BP Measurement'
and complete_pro.proid=pro_list.proid
and complete_pro.sysid='$sysid'
and complete_pro.transid='$transid';
$resneh=safe_query($neh);
while ($rown=mysql_fetch_array($resneh)){
$compl_date2=$rown['compl_date'];
}
 echo P2. Ankle/Arm BP Measurement $compl_date2; and so on and so on...

It seems that I could use a 'for' loop in the searches, but how do I
populate the result fields (some of which will be empty) with the
appropriate tests.
Any thoughts.
Ozzie


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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
has not marked as read. Your mileage may vary ;^)

$sql_getNews = SELECT newsID FROM news WHERE CURDATE()
BETWEEN startDate AND endDate;

$result_getNews = mysql_query($sql_getNews)
or die(mysql_error());

$sql_getReadItems = SELECT newsID FROM newsReadBy WHERE
userID='.$creatorID.';

$result_getReadItems = mysql_query($sql_getReadItems)
or die(mysql_error());

$readList = mysql_fetch_array($result_getReadItems);//turn
Resource ID into an assoc. array

//check to see if a valid newsID ($newsList[newsID]) has
already been read (appears in $readList)
while($newsList = mysql_fetch_array($result_getNews)){
if($readList){
if (!in_array($newsList[newsID],
$readList)){
$displayThese[] =
$newsList[newsID];
}
}
else{
$displayThese[] = $newsList[newsID];
}
}

Rich

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 Sent: Thursday, March 06, 2003 11:36 AM
 To: Hutchins, Richard
 Cc: [EMAIL PROTECTED]
 Subject: RE: [PHP-DB] Populate Array During Loop With in_array
 
 
 
 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
 
 
   

 Hutchins, Richard   

 [EMAIL PROTECTED]   To: 
 [EMAIL PROTECTED]   
 geusa.comcc: 

   Subject:
  RE: [PHP-DB] Populate Array During Loop With in_array 
 03/06/2003 11:33 AM   

   

   

 
 
 
 
 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: Rich Gray [mailto:[EMAIL PROTECTED]
  Sent: Thursday, March 06, 2003 10:05 AM
  To: Hutchins, Richard; [EMAIL PROTECTED]
  Subject: RE: [PHP-DB] Populate Array During Loop With in_array
 
 
   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($convReadList != ){
   for($i = 0; $i  $countNewsItems; $i++){
if (!in_array($newsList[$i],
   $convReadList)){
 //echo
  $newsList[$i]. was
   found\n;
 $displayThese[$i] =
   $newsList[$i];
}
   }
  }
  else{
   echo preadList is empty/p;
  }
 }
 print_r($displayThese);
  
  
 
  You're resetting $i back to 0 for each row returned from the
  database. So if
  there are multiple rows (which you say there are) then the
  array entries
  will get overwritten each time...
 
  HTH
  Rich
 
 
 --
 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] 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
attention to this thread.

Rich


$sql_getNews = SELECT newsID FROM news WHERE CURDATE()
BETWEEN startDate AND endDate;

$result_getNews = mysql_query($sql_getNews)
or die(mysql_error());

$sql_getReadItems = SELECT newsID FROM newsReadBy WHERE
userID='.$creatorID.';

$result_getReadItems = mysql_query($sql_getReadItems)
or die(mysql_error());

while($row = mysql_fetch_array($result_getReadItems)){
$readList[] = $row[newsID];
}

//check to see if a valid newsID ($newsList[newsID]) has
already been read (appears in $readList)
while($newsList = mysql_fetch_array($result_getNews)){
if(isset($readList)){
if (!in_array($newsList[newsID],
$readList)){
$displayThese[] =
$newsList[newsID];
}
}
else{
$displayThese[] = $newsList[newsID];
}
}
if(isset($displayThese)){
return $displayThese;
}
else{
$displayThese = NULL;
return $displayThese;
}


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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
have it turned off, you're SOL.


--- Mignon Hunter [EMAIL PROTECTED] wrote:
 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 web server
 stat
 programs allow for this.  The one we use is http://www.analog.cx/
 and we
 have it configured to capture user agents.
 
 mignon
 
 On Thu, 2003-03-06 at 08:58, Matthew Moldvan wrote:
  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
  should get you started, at least. :)
  
  Good luck, and for curiosities sake let me know how the project
 turns out.
  
  Regards,
  Matthew Moldvan
  
  ---
   System Administrator
   Trilogy International, Inc
http://www.trilogyintl.com/ecommerce/
  --- 
  
  
  -Original Message-
  From: Bruce Levick [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, March 05, 2003 6:26 PM
  To: [EMAIL PROTECTED]
  Subject: [PHP-DB] Storing browser stats
  
  
  Is there a method for storing each users browser stats within a
 database
  table.
  
  So everytime someone visits the browser info is gathered and
 stored as a
  unique row in the 'browser' table in the database.
  
  Any advice??
  
  Cheers
  
  -- 
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 -- 
 Mignon Hunter
 Web Developer
 Toshiba International
 713.466.0277 x 3461
 
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 


=
Mark Weinstock
[EMAIL PROTECTED]
***
You can't demand something as a right unless you are willing to fight to death to 
defend everyone else's right to the same thing.
***

__
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[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 them via a simple

Previous | 1 2 3 4 5 | Next

type of scenario.

I got a query thus

$result2=mysql_num_rows($result);

to count our results. Does anyone have any pointers on what to do next?

Cheers
mikek

-- 
Mike Karthauser 
Managing Director - Brightstorm Ltd

Email[EMAIL PROTECTED]
Web  http://www.brightstorm.co.uk
Tel  0117 9426653 (office)
   07939 252144 (mobile)

SnailmailUnit 8, 14 King Square,
   Bristol BS2 8JJ


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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 may yield additional leads on other sites such as freshmeat and
phpbuilder.

Good luck,
Rich

 -Original Message-
 From: mike karthauser [mailto:[EMAIL PROTECTED]
 Sent: Thursday, March 06, 2003 1:32 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] How to page results?
 
 
 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 them via a simple
 
 Previous | 1 2 3 4 5 | Next
 
 type of scenario.
 
 I got a query thus
 
 $result2=mysql_num_rows($result);
 
 to count our results. Does anyone have any pointers on what 
 to do next?
 
 Cheers
 mikek
 
 -- 
 Mike Karthauser 
 Managing Director - Brightstorm Ltd
 
 Email[EMAIL PROTECTED]
 Web  http://www.brightstorm.co.uk
 Tel  0117 9426653 (office)
07939 252144 (mobile)
 
 SnailmailUnit 8, 14 King Square,
Bristol BS2 8JJ
 
 
 -- 
 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: 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) {
$neh=select * from pro_list, complete_pro where pro_list.pro_name
='$exam'
and complete_pro.proid=pro_list.proid
and complete_pro.sysid='$sysid'
and complete_pro.transid='$transid';
$resneh=safe_query($neh);
$exam_count = 0;
while ($rown=mysql_fetch_array($resneh)){
$exam_dates[$exam][$exam_count] = $rown['compl_date'];
$exam_count++;
}
}
foreach ($array_of_exams as $exam = $description) {
foreach ($exam_dates[$exam] as $date_done) {
echo p1. $description : $date_done;
}
}

That should do all that u want
It will list all exam times that meet your search.

Joel Colombo



Robin Sanchez [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 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 complete_pro.sysid='$sysid'
 and complete_pro.transid='$transid';
 $resneh=safe_query($neh);
 while ($rown=mysql_fetch_array($resneh)){
 $compl_date1=$rown['compl_date'];
 }
 echo p1. Neurological Exam and History $compl_date1;

 $neh=select * from pro_list, complete_pro where pro_list.pro_name ='Ankle
 Arm BP Measurement'
 and complete_pro.proid=pro_list.proid
 and complete_pro.sysid='$sysid'
 and complete_pro.transid='$transid';
 $resneh=safe_query($neh);
 while ($rown=mysql_fetch_array($resneh)){
 $compl_date2=$rown['compl_date'];
 }
  echo P2. Ankle/Arm BP Measurement $compl_date2; and so on and so
on...

 It seems that I could use a 'for' loop in the searches, but how do I
 populate the result fields (some of which will be empty) with the
 appropriate tests.
 Any thoughts.
 Ozzie




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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/name-of-report/name-of-report.num-page 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 open the
name-of-report.0 (the first page).

Other information :

. There are 2.002 reports montly (so under MMDD directory I have
2002 entries).
. There are 210.000 pages montly.
. The bigest report have 45.217 pages (so under name-of-report
directory I have in the worse case 45.217 entries).
. The smallest report have 16 pages (so under name-of-report directory
I have in the best case 16 entries).
. The average pages report is 7213 by day.

 I have the next dudes (I hope you can help me, or tell me where I can
go) :

. The Linux filesystem support that number of files without degrading
the performance?
. Any knows if exist something similar, or how i can search this under
what concept.
. Any other ideas to implement this?
. For the moment i forgot the idea about zip the files I talk with
my boss and get more disk... :-)

pd.: sorry about the size of the mail i try to be more cleary possible.

Regards,
Patricio.

- Original Message -
From: 1LT John W. Holmes [EMAIL PROTECTED]
To: Patricio Vera S. [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Tuesday, March 04, 2003 2:45 PM
Subject: Re: [PHP-DB] Mysql compress text field?


  I have a new project where i need show pages of report on demmand.
 That
  reports are created in the batch process, and the whole file size is
about
 5
  Gb. (thats includes all the reports in a month, I need save about 12
 month).
 
  I think in two alternatives :
 
  1. I save the links in a mysql database, but the files are
compressed
  (in zip format) in several directories, one directorie by day, so when
the
  user request one report, I query the database, go to the path,
decompress
  the file and return to the user.

 Use this method.

  2. I save the reports on the mysql database, so when the user
request
  one report, I query the database and return the report. But if MySql
don't
  compress the text field, that way is not practicable (HDD is limited).

 You'd have to zip the files, then read the data to insert into the table.
 Then, to retrieve, you'd have to select the data out, write it to a file
and
 unzip it before you sent it to the user. (According to your remarks)
Sounds
 like a lot of wasted time to me.

 ---John Holmes...


 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

___
Yahoo! Móviles
Personaliza tu móvil con tu logo y melodía favorito 
en http://moviles.yahoo.es

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[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'] = 'Butt Examination History';
$exam_dates = Array();
foreach ($array_of_exams as $exam = $description) {
$neh=select * from pro_list, complete_pro where pro_list.pro_name
='$exam'
and complete_pro.proid=pro_list.proid
and complete_pro.sysid='$sysid'
and complete_pro.transid='$transid';
$resneh=safe_query($neh);
$exam_count = 0;
while ($rown=mysql_fetch_array($resneh)){
$exam_dates[$exam][$exam_count] = $rown['compl_date'];
$exam_count++;
}
}
foreach ($array_of_exams as $exam = $description) {
foreach ($exam_dates[$exam] as $date_done) {
echo p1. $description : $date_done;
}
}

That should do all that u want
It will list all exam times that meet your search.

Joel Colombo



Robin Sanchez [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 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 complete_pro.sysid='$sysid'
 and complete_pro.transid='$transid';
 $resneh=safe_query($neh);
 while ($rown=mysql_fetch_array($resneh)){
 $compl_date1=$rown['compl_date'];
 }
 echo p1. Neurological Exam and History $compl_date1;

 $neh=select * from pro_list, complete_pro where pro_list.pro_name ='Ankle
 Arm BP Measurement'
 and complete_pro.proid=pro_list.proid
 and complete_pro.sysid='$sysid'
 and complete_pro.transid='$transid';
 $resneh=safe_query($neh);
 while ($rown=mysql_fetch_array($resneh)){
 $compl_date2=$rown['compl_date'];
 }
  echo P2. Ankle/Arm BP Measurement $compl_date2; and so on and so
on...

 It seems that I could use a 'for' loop in the searches, but how do I
 populate the result fields (some of which will be empty) with the
 appropriate tests.
 Any thoughts.
 Ozzie


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[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.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] 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 idea of how to get an exact answer 
to 2decimal places of the subtraction of the two times?

cheers,
dave


_
Chat online in real time with MSN Messenger http://messenger.msn.co.uk
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


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, 6 Mar 2003, David Rice wrote:



 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 idea of how to get an exact answer
 to 2decimal places of the subtraction of the two times?

 cheers,
 dave



 _
 Chat online in real time with MSN Messenger http://messenger.msn.co.uk


 --
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


---
Peter Beckman  Internet Guy
[EMAIL PROTECTED] http://www.purplecow.com/
---

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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 have an idea of how to get an exact
answer
 to 2decimal places of the subtraction of the two times?

Read the manual. These two functions will probably come in handy (assuming
MySQL):

SEC_TO_TIME(seconds)
Returns the seconds argument, converted to hours, minutes, and seconds, as a
value in 'HH:MM:SS' or HHMMSS format, depending on whether the function is
used in a string or numeric context:
mysql SELECT SEC_TO_TIME(2378);
- '00:39:38'
mysql SELECT SEC_TO_TIME(2378) + 0;
- 3938

TIME_TO_SEC(time)
Returns the time argument, converted to seconds:
mysql SELECT TIME_TO_SEC('22:23:00');
- 80580
mysql SELECT TIME_TO_SEC('00:39:38');
- 2378So... SELECT
SEC_TO_TIME(TIME_TO_SEC(column1)-TIME_TO_SEC(column2)) AS Difference
...---John Holmes...


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[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 it?




-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[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.sold=1 AND table1.id NOT IN
(SELECT table2.table1_id FROM table2)

(and no, those aren't the real table or field names - just trying to be
clear)

I could do a SELECT first that gets all the values in the table2, then (in
PHP) run through a result set of rows from table1, checking each time to see
if its id is in table2, and if it isn't, display it...but this seems
excessive.

I went through all of the functions to use in a WHERE clause in my MySQL
book...am I missing something?

Thanks,
--
Katie Evans-Young
Web Developer
Evans-Young Designs
E-mail: [EMAIL PROTECTED]
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.445 / Virus Database: 250 - Release Date: 1/21/2003


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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
---Original Message---
 
From: drparker
Date: Thursday, March 06, 2003 13:46:58
To: [EMAIL PROTECTED]
Subject: [PHP-DB] retrieve last n records
 
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 it?
 
 
 
 
-- 
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] 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 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
 
 


[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 List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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 field.  So
basically, I need to be able to retrieve those last n rows where user_id =
whatever, then be able to sort those last 3 rows ASC or DESC by any field.



Jim Hunter wrote:



  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

 ---Original Message---



 From: drparker

 Date: Thursday, March 06, 2003 13:46:58

 To: [EMAIL PROTECTED]

 Subject: [PHP-DB] retrieve last n records



 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 it?









 --

 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] 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 sort
order. It is not that hard to sort an array and you might be able to find a
class already written to do this on the PHP classes web site.  You might
even go so far as to display the info in a table that allows the user to
click on a column heading and re-sort the data on-the-fly without a round
trip to the server. This might add a nice touch to your UI without too much
effort.

Jim 
 
---Original Message---
 
From: drparker
Date: Thursday, March 06, 2003 14:23:29
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] retrieve last n records
 
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 field. So
basically, I need to be able to retrieve those last n rows where user_id =
whatever, then be able to sort those last 3 rows ASC or DESC by any field.



Jim Hunter wrote:



 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

 ---Original Message---



 From: drparker

 Date: Thursday, March 06, 2003 13:46:58

 To: [EMAIL PROTECTED]

 Subject: [PHP-DB] retrieve last n records



 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 it?









 --

 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: 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 to one line.

Ehm.. add a newline ('\n') at appropriate places?


-- 
--Fredrik
A cynic is a person searching for an honest man, with a stolen
lantern.
-- Edgar A. Shoaff

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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.  Secondly, which PHP classes website are you referring to? 
I don't even know how I would use a PHP class in conjunction with it if 
I did find the site.  Thirdly, I do need to re-sort the data on-the-fly. 
 Would this essentially be accomplished if I were just sorting the 
table data via PHP functions?

Thanks for your help.

Jim Hunter wrote:

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 sort
order. It is not that hard to sort an array and you might be able to find a
class already written to do this on the PHP classes web site.  You might
even go so far as to display the info in a table that allows the user to
click on a column heading and re-sort the data on-the-fly without a round
trip to the server. This might add a nice touch to your UI without too much
effort.


Jim 

 

---Original Message---

 

From: drparker

Date: Thursday, March 06, 2003 14:23:29

To: [EMAIL PROTECTED]

Subject: Re: [PHP-DB] retrieve last n records

 

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 field. So

basically, I need to be able to retrieve those last n rows where user_id =

whatever, then be able to sort those last 3 rows ASC or DESC by any field.







Jim Hunter wrote:






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



---Original Message---





From: drparker



Date: Thursday, March 06, 2003 13:46:58



To: [EMAIL PROTECTED]



Subject: [PHP-DB] retrieve last n records





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 it?











--



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] 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 anyone help me with this?


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[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.  Can someone please look and help me so that I can upload the image
to that folder.

Thank you!
In Kindness
Stephen K Knight


?

if(!empty($userfile))
{
 $abpath = /logos/ . $newname;

echo FileUpload2.php;
echo $username;
echo $newname;
echo $abpath;

   //copy the file
 //  copy($userfile, $abpath);

   //destroy the uploaded file
//   unlink($userfile);

   // write javascript to store the newname
//   echo script language='javascript'\n;
//   echo newname = ' . $newname . ';\n;
//   echo /script\n;
}


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[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/unsub.php



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.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-db
--
/*
I never cheated an honest man, only rascals.  They wanted something for
nothing.  I gave them nothing for something.
-- Joseph Yellow Kid Weil
*/


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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 2 tables but using a primary key from one.

Here is what I think it should look like.

SELECT item_id, subtotal, quantity from shopping_cart WHERE order_id =
(SELECT order_id FROM orders WHERE session_id = session_id()) AND
customer_id = $customer_id;

-Jonathan








--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php