RE: [PHP-DB] sessions

2002-05-23 Thread matt stewart

if you don't want people to log in, then sessions are really the only
sensible way of solving the basket solution.

-Original Message-
From: James Kupernik [mailto:[EMAIL PROTECTED]]
Sent: 23 May 2002 16:15
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] sessions


Thanks .. it is the wonders of open source.

Are sessions required for a shopping basket? I don't want people to login,
just order and go.

"Matt Stewart" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> i'd imagine there'll be a decent one on phpbuilder, or devshed, or
> webmonkey, or phpwizard
> if not, there's plenty of source code for existing shopping cart systems
> around these sites, so you can take them and rewrite it to your liking and
> design!
> the wonders of open source!
>
> -Original Message-
> From: James Kupernik [mailto:[EMAIL PROTECTED]]
> Sent: 23 May 2002 15:48
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP-DB] sessions
>
>
> Do you know where there is any good tutorials on creating a php shopping
> cart?
>
> I enabled the auto.session_start .. then took out session_start .. that
> seemed to do the trick.
>
> Any help on php shopping carts would be great!
>
> Thanks
>
> "Matt Stewart" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > sent the session_start(); before any output, that should do it...
> >
> > -Original Message-
> > From: James Kupernik [mailto:[EMAIL PROTECTED]]
> > Sent: 23 May 2002 15:38
> > To: [EMAIL PROTECTED]
> > Subject: [PHP-DB] sessions
> >
> >
> > I get this error when I try to start a session (I'm trying to create a
> > shopping cart).
> >
> > Warning: Cannot send session cache limiter - headers already sent
> >
> >
> > Thanks
> >
> >
> >
> > --
> > 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 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] sessions

2002-05-23 Thread matt stewart

i'd imagine there'll be a decent one on phpbuilder, or devshed, or
webmonkey, or phpwizard
if not, there's plenty of source code for existing shopping cart systems
around these sites, so you can take them and rewrite it to your liking and
design!
the wonders of open source!

-Original Message-
From: James Kupernik [mailto:[EMAIL PROTECTED]]
Sent: 23 May 2002 15:48
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] sessions


Do you know where there is any good tutorials on creating a php shopping
cart?

I enabled the auto.session_start .. then took out session_start .. that
seemed to do the trick.

Any help on php shopping carts would be great!

Thanks

"Matt Stewart" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> sent the session_start(); before any output, that should do it...
>
> -Original Message-
> From: James Kupernik [mailto:[EMAIL PROTECTED]]
> Sent: 23 May 2002 15:38
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] sessions
>
>
> I get this error when I try to start a session (I'm trying to create a
> shopping cart).
>
> Warning: Cannot send session cache limiter - headers already sent
>
>
> Thanks
>
>
>
> --
> 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 Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] sessions

2002-05-23 Thread matt stewart

sent the session_start(); before any output, that should do it...

-Original Message-
From: James Kupernik [mailto:[EMAIL PROTECTED]]
Sent: 23 May 2002 15:38
To: [EMAIL PROTECTED]
Subject: [PHP-DB] sessions


I get this error when I try to start a session (I'm trying to create a
shopping cart).

Warning: Cannot send session cache limiter - headers already sent


Thanks



-- 
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] displaying records

2002-05-23 Thread matt stewart

at first glance i'd assume that the variable $category is not being passed
through to the second page - you're using it to get the first query, but not
keeping it (either in the url or hiddenform variable for your next page
link).

-Original Message-
From: Natividad Castro [mailto:[EMAIL PROTECTED]]
Sent: 23 May 2002 13:13
To: [EMAIL PROTECTED]
Subject: [PHP-DB] displaying records


Hi to all,
I'm displaying a set of records in different pages.
The user will be able to search by category, let say a user wants to search
projects that belong to 'PHP' category, so I will list all the projects that
belong to that category.
My problem is: the first 10 records on the first page display without any
problem, but when I try to go to the next page it doesn't display any
record.
The weird thing is that if I write my query: SELECT * FROM 150BK WHERE
CATEGORY='PHP', I don't any problem I can see all my record and go through
from page to page. But when I write my query requesting the name from the
drop down menu from the search page I get just the first 10 records.
For example, SELECT * FROM 150BK WHERE CATEGORY='$category' //here is where
the problem

Any help is greatly appreciate
Thanks in advanced
Nato

here is my code



Record Set Paging with Page Navigation



PHP/MySQL Record Set Paging with Page Navigation
 0) {
   $sql .= " LIMIT $offset, $pagesize ";   // Get record set = pagesize
every time
   $result = mysql_query($sql);
   if ($absolutepage == 1) {
$pag1 = $absolutepage;
   } else {
$pag1 = (($absolutepage - 1) * $pagesize) + 1;
   }
   $pag2 = $pag1 + ($pagesize - 1);
   if ($pag2 > $recordcount)
$pag2 = $recordcount;
   echo "";
   echo "Displaying records $pag1 to $pag2 (of " . $recordcount.")";
   PagNav($pagesize, $pagecount, $absolutepage, $recordcount, $sql, $url) ;
   echo "";
   $fields = mysql_num_fields($result);
 for ($i=0; $i < $pagesize; $i++) {
 while($query_data = mysql_fetch_array($result))
 {
 $id = $query_data[ID];
 $name = $query_data[NAME];
  echo $id. " | ".$name. " " . "read
more..." . "" . "";
  echo "";
  }
   echo "\n";
   }

   } else {
   echo "No records found.";
}
echo "";


function PagNav($pagesize, $pagecount, $absolutepage, $recordcount, $sql,
$url)
{
global $sql, $url, $pagesize, $pagecount, $absolutepage, $recordcount;
$pad="" ;
$maxpages = $pagecount ;
if ( ($absolutepage % 10) == 0) {
   $counterstart =  $absolutepage - 9 ;
} else {
   $counterstart = $absolutepage - ($absolutepage % 10) + 1 ;
}
$counterend = $counterstart + 9 ;
echo "Page ".$absolutepage." of ".$pagecount.": ";
if ($counterend > $maxpages) $counterend = $maxpages ;
if ($counterstart != 1) {
   $ref = "First | " ;
   echo $ref ;
   $ref = "Prev 10 Pages " ;
   echo $ref ;
}
echo "[ " ;
for ($counter = $counterstart; $counter < $counterend +1;$counter++ ) {
if ($counter >= 10) $pad="" ;
if (! ($counter == $absolutepage)) {
   $ref = "" . $pad . $counter . "" ;
} else {
   $ref = "" . $pad . $counter . "" ;
}
echo $ref ;
if (!($counter == $counterend)) print " " ;
}
echo " ]" ;
if ($counterend != $maxpages) {
$ref = " Next 10 Pages" ;
echo $ref ;
$ref = " | Last" ;
echo $ref ;
}
echo "";
}
?>


-- 
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] Anti-virus alarm! Sulfbnk var inget virus.

2002-05-16 Thread matt stewart

bit cynical maybe craig???
i think he actually made an honest mistake and is trying to rectify the
situation... 
don't think there's any harm done, just a couple more emails to delete from
the inbox!

-Original Message-
From: Craig Vincent [mailto:[EMAIL PROTECTED]]
Sent: 16 May 2002 11:51
To: Trond Erling Hundal
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Anti-virus alarm! Sulfbnk var inget virus.


> Beklager forrige epost, det viser seg at jeg og en god del andre har
> blitt lurt.
> Her er en webside som forklarer hvordan du reparerer feilen:
>
> http://netsquirrel.com/msconfig/sulf.html
>
> Filen sulfnbk.exe er en fil som gjenoppretter lange filnavn.
>
>
> English:
>
> Sorry for the last email, it seems, this file "sulfnbk.exe" only
> restores long filenames.
> Here's a link to a page that explains how you can restore the file.
> http://netsquirrel.com/msconfig/sulf.html

Buahahahaboy do I smell a troll.  Innovative way to spam a list with an
advertisement I must say.  Better be careful though, piss the wrong person
off with a scam like this and you could have a lawsuit on your hands.

Sincerely,

Craig Vincent



-- 
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] Virus alarm!

2002-05-16 Thread matt stewart

DON'T!!
this file is on everyones machine, and is not a virus!!

-Original Message-
From: Trond Erling Hundal [mailto:[EMAIL PROTECTED]]
Sent: 16 May 2002 10:26
To: ,; -=* Alf Marius *=-; Abonnement; Alf Halsen; Alf Lange De;
Amajonaz . . .; Andreas Nordenstam; Andrey Hristov; 'Andy'; Arik Ashepa;
Arild Andersen; B I K K E L; Bengt; Bengt Hundal; Bengt Hundal;
Bengt@Innovationmanagement. No; Bent Erik; Berlina; Bind mailinglisten;
Bjorn Algroy/HSD_NO/NO; BJØRN GRØNHAUG; Bogdan Stancescu; Bogen Skole;
Borland Community; Brad Knowles; Børge; Cami; CityProsjekt - Trond
Johansen; Cody DeHaan; Consumer_Support; Costas Halvajoglou; Craig
Vincent; Dag. Sorlie@Kystdir. Dep. No; Daniel Berwig; DanielW; Dave
Watkinson; DevShed. com Announcement ListList Confirmation from
ListManagerSQL; Dobromir Velev; Dontoni@Dontoni. Net; E. James Nagle;
Eep@Unifeeder. Com; Eivind Hellandsjø Hjemme; Eivind Hjem; Eivind Olsen;
Eivind Stoveland; Eivind@Havneavisen. Net; Emma@Internet21. Co. Uk; Erik
Nordmark; Erlend Hansen Juvik; Espen Andve; Espen Johs. Christophersen;
Evvind Stoveland; Fabian Vreede; Finn Humborstad; Fluorine@Spray. No;
Frank; Frank Lorvik; Frode Island Bergan; George Lioumis; George
Pitcher; Germanguys@Yahoo. Com; Goachim@Marmelade. Net;
[EMAIL PROTECTED]; Gustav Foseid; Gustav Foseid; Gustav Foseid; Guttorm
Fjortoft; Hallgrim Bjørvik; Halvorsen Helge Svein; Harald Arntsen;
Harald Normann; Harry Hundal; Harry Kjønsø; Havneavisen Knut Totland;
Hayan@Ureach. Com; Henry Chan; Herr K; Hilde@Havneavisen. Net; Hjellum
Eivind; Holmen Linda; Hostmaster Netthus /v Roger Birkeland; Hugh
Kimber; Ian Stoffberg; "Im Kontoret \(Business Fax\)"; InCreo
Interactive Creations AS; Info@Norid. No; Ingunn Stray; Innovation
Management as; Innset Jørn; Intranet AS; ISP-Bandwidth; ISP-BANDWIDTH
Discussion List Confirmation from internet.com; ISP-BROADBAND Discussion
List Confirmation from internet.com; ISP-CABLE Discussion List
Confirmation from internet.com; ISP-DNS Discussion List Confirmation
from internet.com; [EMAIL PROTECTED]; ISP-DOMAINS Discussion List
Confirmation from internet.com; ISP-DSL Discussion List Confirmation
from internet.com; ISP-EMAILSERVERS Discussion List Confirmation from
internet.com; [EMAIL PROTECTED];
Isp-Marketing@Isp-Marketing. Com; ISP-WEBHOSTING Discussion List
Confirmation from internet.com; [EMAIL PROTECTED]; Ivar
Torseth; Ivo; Jacob E. Reinertsen; James A Griffin; Jan Fredrik; Jan
Fredrik; Jan Fredrik Stoveland; Jan Rune Løvlie; Jennifer Arcino
Demeterio; Jim Reid; John Kopparhed; Jonas Lie; Jonathan Hilgeman; Jorg.
Bakken@If. No; Joseph S D Yao; Jørgen Dahl; Jørgen Dahl; Jørgen Dahl I;
K; Karl Birger Sælør; Kjell Olav Skjølsvik; Kjetil. Tranberg@Pbm.
Geveke. Com; Klaus; Knut; Knut; Knut Totland; Kontaktoss@Nextra. No;
Leif Øverland; Len Conrad; Lennart Hovland; [EMAIL PROTECTED]; Loving each
day like the last...si funciona y funciona muy bien :):D(y):O;); Løkken
Terje; Mad Nas; Mai-Bente; Marek Rzewuski; Mariann Gressum; Marianne
Brurok; 'Mark Weber'; [EMAIL PROTECTED]; Matthew Tedder; May; May;
Memorex kis; Mette - Havneavisen; Midtnorsk@Transportarbeider. No;
Mæland Torbjørn; Nautilis; Norway Nordic Customer Service;
Nyhetsbrev@Havneavisen. Net; Odd Inge Uleberg; Odd Joar Svensson;
Oddbjørn Aunhaug; Ole A. Pettersen; OLE MARTIN JR GRINDE; Ole.
Seavild@Sea-Cargo. No; Otto. Lyse@bennett. No; Patrice@Ozeo. Com; Paul
Gardiner; PAUL OLAV PEDERSEN; Per Arne; Per Kåre Kjønsvik; Peter Helset;
Mysql Mailinglist; Phped@Soysal. Com; Pierrot; Plan Doing All That He
Can; Psy@Trance. Net; "Psy@Trance. Net \(Business Fax\)"; "Psy@Trance.
Net \(Home Fax\)"; Psy-Request@Trance. Net; Paal Ellefsen; R. J.
Michell@Apu. Ac. Uk; Randi Carlsen; Randi Thørring; Rec10;
Reeltime@Reeltime; Registry|WinEasy; Regsupport@Activeisp. No; Rick
Emery; Rita Floer; robert; Roger Birkeland; Roger Tvedten; Rolf E.
Hundal; Rolf E. Hundal; Rolf Inge Valde; Root; Root; Root@Havneavisen.
No; Roy Arends; RSalomo; Rune Korneliussen; Safi; Safi; Safi; Safi85;
Salg@Easyisp. Org; Salg@Innovationmanagement. No; Salg@Komplett. No;
Schjerva Roger; Sendmail-Questions@Sendmail. Org; Shawna; Simon.
Pospisil@Fastsearch. Com; Skiltmannen; Soeholt Per; Spring Calvin fellow
Hawke; [EMAIL PROTECTED]; Stav Johanssen Trykkeri AS; Steven Chagnot;
Stian; Stian Pedersen; Stiftelsen Fullriggeren Sørlandet; Stig Bolme;
Stig Ottar; Stoveland Consult; [EMAIL PROTECTED]; Support@Activeisp.
No; Support@Komplett. No; Support@Secondary. Com; Support@Wineasy. Se;
Svein Waade; Sverrir Ragnarsson; Teknostallen; Telecom. No Nyhetsbrev;
Tellef Øgrim; Terje Endresen; Thomas "Omega" Henning; Thorleif Vikre;
Tom Børresen; Tomas; Tomas Bjerved; Tone. Moe@Norcargo. No; Torild
Hundal; Torild Hundal; torrentUK; Torrunes@Datakompaniet. No; Tove Irén
Becker; Tron; Trond E. Hundal; Trond Erling Hundal; Trond Erling Hundal;
Trond Erling Hundal; Trond Erling Hundal; Trond Erling Hundal;
Trond@Havneavisen. No; Trond@Lunden. As; Ulf Øines; Unnamed;
Webmaster@Fsvf. No; [

RE: [PHP-DB] session variables across several pages

2002-05-15 Thread matt stewart

i would consider trying changing the variable names - so the field  on the
form would be called "address", therefore the variable passed through would
be $address, and then have the session variable called "sess_address" or
something like that, and then do  

$HTTP_SESSION_VARS['sess_address']=$address;

see if that makes any difference?

-Original Message-
From: Terry Romine [mailto:[EMAIL PROTECTED]]
Sent: 15 May 2002 16:40
To: matt stewart
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] session variables across several pages 


This is freaky.

If I change the  I can see the e_address coming in 
correctly, but it gets changed back to old value -- by the 
session_register('e_address')??

should I have something along the line of
if(!$e_address) register_session('e_address');
???

On Wednesday, May 15, 2002, at 09:57  AM, matt stewart wrote:

> You need to look up $HTTP_SESSION_VARS['name']  - that's how to change 
> the
> variables when they are already set..
> i think most people have this problem when they first use sessions!
>
Terry Romine
Web Developer
JumpInteractive.com

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




RE: [PHP-DB] session variables across several pages

2002-05-15 Thread matt stewart

You need to look up $HTTP_SESSION_VARS['name']  - that's how to change the
variables when they are already set..
i think most people have this problem when they first use sessions!

-Original Message-
From: Terry Romine [mailto:[EMAIL PROTECTED]]
Sent: 15 May 2002 15:49
To: [EMAIL PROTECTED]
Subject: [PHP-DB] session variables across several pages 


First, forgive me if this seems to be cross post -- but it does involve 
both PHP and MySQL.

My client requirements are:
 From their website, they display a list of classes. On registering for a 
class, the user is sent to a secure page that is hosted on a different 
secured server that does not have access to the client's MySQL database. 
I pass in the class info so the registration form can display
"Registering for class $title$start_date$cost"
The form then gathers name, address, etc including credit card info.

On submitting the form, the data is processed and a PGP email is sent 
out to the registar.

Then a thank you page is displayed and the user is forwarded back to the 
main site, where a second page is displayed allowing for either download 
of class materials or to return to the class list. This page is where I 
post the necessary info into the MySQL database.

So my dilemma -- I want to use session_register to capture the field 
info from the registration form and then read it back out on the website 
thank you page.

I have
 session_start();
 session_register("start_date");
 session_register("end_date");
 session_register("section");
 session_register("class");
 session_register("title");
 session_register("class_id");
 session_register("register_id");
 session_register("name");
 session_register("employer");
 session_register("e_address");
 session_register("e_city");
 session_register("e_state");
 session_register("e_zip");
at the beginning of the form page (select_class.php) and the thank you 
page on their website (thanks.php) where I post the info to MySQL.
The form includes inputs such as
 Name:
 
   
 

What happens is that old data shows up for name, and address (the only 
fields I have tested so far) regardless of what I enter in the form. I 
was under the impression that a registered variable is updated once the 
page is processed. If I am calling the same page (select_class.php) to 
process the form, does the data get reverted somehow? The data just 
doesn't seem to get updated to the form inputs.

What might I be missing?

Thanks in advance
Terry Romine
Web Developer
JumpInteractive.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




RE: [PHP-DB] Using functions in SELECT statements

2002-05-02 Thread matt stewart

The problem is that you can't do a php function on a field name inside a
query, only on the contents after the query has already been executed!

The LIKE function in sql is case insensitive anyway, so you'll pull out all
the matches just by using:

$sql = "SELECT * FROM Organisation_Membership WHERE organisation LIKE
'%$SearchBox'";

if this is the wrong anser, and you were trying to do something different,
let me know!

Matt Stewart

[EMAIL PROTECTED]




-Original Message-
From: Robin S McKenzie [mailto:[EMAIL PROTECTED]]
Sent: 02 May 2002 15:11
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Using functions in SELECT statements



If only it were that simple - sorry, that was a copying error...

It gives the error " undefined function: lower"

R

Robin McKenzie Department of Mechanical Engineering University of Bristol
e:[EMAIL PROTECTED] e:[EMAIL PROTECTED] m:+44(0)7970 058712

"Peter Lovatt" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
>
>
> Could it be the second $ in the lower('%$SearchBox$%') ?
>
> Peter
>
>
>
> ---
> Excellence in internet and open source software
> ---
> Sunmaia
> www.sunmaia.net
> [EMAIL PROTECTED]
> tel. 0121-242-1473
> ---
>
> > -Original Message-
> > From: Robin S McKenzie [mailto:[EMAIL PROTECTED]]
> > Sent: 02 May 2002 14:34
> > To: [EMAIL PROTECTED]
> > Subject: [PHP-DB] Using functions in SELECT statements
> >
> >
> >
> > I'm trying perform a case-insensitive test for a name.  These are stored
> > like "Association of ...", and I want to convert both the filter and the
> > test data to lower- (or upper-) case.  Why doesn't this work:   ?
> >
> > SELECT *
> > FROM [Organisation Membership]
> > WHERE lower(organisation) LIKE lower('%$SearchBox$%')
> >
> > Robin McKenzie
> > Department of Mechanical Engineering
> > University of Bristol
> > e:[EMAIL PROTECTED]
> > e:[EMAIL PROTECTED]
> > m:+44(0)7970 058712
> > 
> >
> >
> >
> > --
> > 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 Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP-DB] calculations based on checkbox value

2002-03-22 Thread matt stewart

can you post some code, and an exmaple of an input, the current output, and
what the desired output would be?

-Original Message-
From: jas [mailto:[EMAIL PROTECTED]]
Sent: 22 March 2002 04:57
To: [EMAIL PROTECTED]
Subject: [PHP-DB] calculations based on checkbox value


Ok here is my problem, currently I have a form that calculates the number of
words in a given textarea.  Now what I need to accomplish is using a
checkbox to subtract a value based on said checkbox.  I have looked for a
tutorial on such an item and did not find one so I am asking if anyone out
there has accomplished a similar function and if so could you point out a
good tutorial or let me see some sample code?  Thanks in advance,
Jas



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

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.338 / Virus Database: 189 - Release Date: 14/03/02
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.338 / Virus Database: 189 - Release Date: 14/03/02
 

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




RE: [PHP-DB] need help guys

2002-03-14 Thread matt stewart

you can't pass a literal "&" in a url - it makes it think that it's the next
variable.

-Original Message-
From: its me [mailto:[EMAIL PROTECTED]]
Sent: 14 March 2002 11:21
To: [EMAIL PROTECTED]
Subject: [PHP-DB] need help guys


i have this

Antiques & Arts

then i pass this to next page:

RE: [PHP-DB] Grouped sql output

2002-02-26 Thread matt stewart

Not entirely sure what you're trying to do, but would it be sensible to
use...
$sql="SELECT * FROM Customers ORDER BY zip ASC";
.
.
and then when you've got the results...
if ($myrow = mysql_fetch_array($result)) {
$zip=0;
$zipcount=0;
do {
if ($zip!=$myrow[zip]){
if ($zipcount!=0){
echo ("\n\n");
}else{
$zipcount=1;
}
echo ("\n$zip\n\n");
}
echo ("$myrow[customer]\n");
}while ($myrow = mysql_fetch_array($result));
echo ("\n\n");
}

or something like that anyways ;)
hope that's useful?
cheers,
  Matt

-Original Message-
From: Rudi Starcevic [mailto:[EMAIL PROTECTED]]
Sent: 26 February 2002 11:02
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Grouped sql output


Hi,

I've done this before in coldfusion.
It's the one thing I'm note sure on how to do the same(ish)
in PHP - my language of choice.
If we have the record set the CF code would look like


 
#zip#

 
#customer#





So I'm think also to use 2 loops for the same purpose in PHP.
Can I do this from the record set like above or do I need
to build array's I wonder ?

Cheers
Rudi.




> Thanks Sven,
> 
> I've already got the sql OK.
>  I have the records set but I want to print it "report like" 
> So It's needs some thing like a loop with an inner loop Like
> 
> 
> 
> zip
> 
> customer
> customer
> 
> zip
> 
> customer
> customer
> 
> 
> 
> 
> Hope this makes sense.
> I'll elaborate more if you think I should.
> Cheers
> Rudi.
> 
> > Hi friends,
> > 
> 
> >  I've been struggling for a while now so I thought I'd ask. 
> > What's the easiest way to for to print group sql output. For 
> > example I need to output customers grouped by zip. Like: zip 
> > customer a customer b zip customer d customer e zip customer 
> > c custoemr f customer g
> > 
> > Do I need to build array's and loop through them or
> >  can I print straight from a record set ( using Postgresql 
> > or Mysql ) Thanks heaps ! Regards Rudi.
> > 
> >  = 
> > Get your personalised email and homepage at www.easymail.info
> > 
> > -- 
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> 
>  =



=
 Get your personalised email and homepage at www.easymail.info

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

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.323 / Virus Database: 180 - Release Date: 08/02/02
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.323 / Virus Database: 180 - Release Date: 08/02/02
 

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




RE: [PHP-DB] How do I add multiple var to a if clause ?

2002-02-21 Thread matt stewart

either
if (($var <= 3)&&($var >= 1)){
}
if you want it to just be somewhere between one and 3,
or

$my_array = array ("1", "2", "3");
if (in_array($variable, $my_array)) {
}
if you want it to be just one of those exact values.


-Original Message-
From: Dave Carrera [mailto:[EMAIL PROTECTED]]
Sent: 21 February 2002 10:40
To: php List
Subject: [PHP-DB] How do I add multiple var to a if clause ?


Hi All

If($var == 1,2,3){
}
This is wrong so what is the right way.

I am try to find out a if var equals either 1 2 or 3 do something type
thing but cant find answers anywhere

Thanks in Advance

Dave Carrera
Php / MySql Development
Web Design
Site Marketing
http://www.davecarrera.com
 



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

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.323 / Virus Database: 180 - Release Date: 08/02/02
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.323 / Virus Database: 180 - Release Date: 08/02/02
 

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




RE: [PHP-DB] numeric string problem

2002-02-13 Thread matt stewart

yeah, i would go with Rick on this.
however, the reason i think it's not working is because it's comparing the
contents alphabetically ie. "2" is greater than "1" but is also greater than
"10", "19" etc etc alphabetically, just as anything beginning with "b"
is greater than "a" and also "aazzxsd".
if you absolutely must continue to use the varchar system, then do a check
on the string length first, and then if they are the same length do a <
check.

-Original Message-
From: Rick Emery [mailto:[EMAIL PROTECTED]]
Sent: 12 February 2002 20:47
To: 'Mike'; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] numeric string problem


The question is: why use varchar?  Why not use INT, then format to includes
commas when displaying?


-Original Message-
From: Mike [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 12, 2002 3:38 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] numeric string problem


Hi,
I am using VARCHAR for  price column : 600,000  700,000 etc
when I use :  PRICERANGE<='$Price'
it works fine except when the $Price moves to 7 digit as 1,000,000
in other words the" less than " does not work when comparing 6 digit and 7
digit  figures
I am not sure how to compensate for this.
Thanks
Mike



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

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.319 / Virus Database: 178 - Release Date: 28/01/02
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.319 / Virus Database: 178 - Release Date: 28/01/02
 

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




FW: [PHP-DB] renaming uploaded files

2002-02-01 Thread matt stewart

Forgot to post to the whole list! sorry

-Original Message-
From: matt stewart 
Sent: 01 February 2002 09:22
To: 'Jose Maria Sala'
Subject: RE: [PHP-DB] renaming uploaded files


Hi Jose - this has a bit of error checking with it too.
this just uploads one file with the name 345.jpg for example.
you may want to do something to produce a number such as 000345 (will allow
up to 99 houses on the database) as this will then make adding 3 images
for the house easier to search for - you can find all images starting with
000345 as opposed to two images 3451, and 34511 (the first image of house
345, and the first image of house 3451!).
For some reason i never manage to write a script which uploads more than one
image at a time, so maybe if you can, you could let me see the code, or if
not, just loop through this uploads page, passing $Pic_Number and
incrementing it each time?
Hope this helps.

Matt

Here's the code:

if ($Image=="none"){
echo "Problem: no file uploaded";
exit;
}

if (($Image_type != "image/gif")&&($Image_type !=
"image/jpeg")&&($Image_type != "image/pjpeg")){
echo "Problem: file is not an image, type is $Image_type";
exit;
}

if (!is_uploaded_file($Image)){
echo "Problem: possible file upload attack";
exit;
}

if ($Image_size == 0){
echo "Problem: Image has zero size";
exit;
}
if ($Image_type=="image/gif"){
$upfile =
"/home/httpd/vhtdocs/mywebsite/images/uploads/".$House_ID.$Pic_Number.".gif"
;
}elseif (($Image_type=="image/jpeg")||($Image_type=="image/pjpeg")){
$upfile =
"/home/httpd/vhtdocs/mywebsite/images/uploads/".$House_ID.$Pic_Number.".jpg"
;
}

if (!copy($Image, $upfile)){
echo "Problem: Could not move file into directory";
exit;
}
echo "File uploaded successfully";

-Original Message-
From: Jose Maria Sala [mailto:[EMAIL PROTECTED]]
Sent: 31 January 2002 20:24
To: [EMAIL PROTECTED]
Subject: [PHP-DB] renaming uploaded files


Hi php developers:

I have created a website for a house renting company with an administration
tool. Using this tool, managers can add, modify and delete data in a mysql
database.

They can also upload some pictures of the houses they rent. The way i do
this is by taking them to the list of houses, making them select one and
next they go to a form. In this form they upload files to a certain folder
in the server.

What i would like to do is auto rename the file with a name composed by
IDNUMBER + NUMBER OF PICTURE (ex. if ID of that house is 345 image name
would be 34501.gif, 34502.gif, 34503.gif,...)

I think you got the idea. Any help would be greatly appreciated.

thx in advance



-- 
PHP Database 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]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.319 / Virus Database: 178 - Release Date: 28/01/02
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.319 / Virus Database: 178 - Release Date: 28/01/02
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.319 / Virus Database: 178 - Release Date: 28/01/02
 

-- 
PHP Database 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-DB] Pictures in MySQL database

2002-01-24 Thread matt stewart

Agreed, i think you'll find aan easy way of doing this is to name each image
after the primary key to your table (ie 1.jpg, 2.jpg, 3.jpg etc if the
primary key is an autonumber. and store them all in a certain file, then
when you fetch the record from the table, you can run a simple check to see
if there is an image corresponding to the record number in that file, and if
so, display it. (if not, you can then use a default image, or a message
saying "no image".
much easier than putting the binary stuff into a database!

-Original Message-
From: Miles Thompson [mailto:[EMAIL PROTECTED]]
Sent: 24 January 2002 14:04
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Pictures in MySQL database


Re the PLS. Nope, replies to private email are contrary to spirit of the
list.

Storing inages in a database is not a good practice. Fetches are slow and 
the database becomes incredibly bloated. Most people store the images on 
disk and a reference to their location in the database and have found this 
faster and more reliable.

Regards - Miles Thompson

At 10:16 AM 1/24/2002 +0100, K wrote:
>Hello,
>
>I would like to create database with many pictures.
>I have problem with inserting pictures to table in MySQL. I created table 
>where one of the name of column is "image". The type of this column is 
>LONGBLOB. How can I insert picture into this column? I tried insert a file 
>(e.g. picture.jpg) to column "image" but I received so strange chars 
>during selecting table.
>
>Best regards
>Kamil
>PLS. Send me more info on my private e-mail.


-- 
PHP Database 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]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 11/01/02
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 11/01/02
 

-- 
PHP Database 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-DB] string compare function

2002-01-17 Thread matt stewart

by the way, what are you actually trying to do with the code? there may be a
different way of doing it which isn't so confusing?

-Original Message-
From: tomhilton [mailto:[EMAIL PROTECTED]]
Sent: 17 January 2002 15:20
To: [EMAIL PROTECTED]
Subject: [PHP-DB] string compare function 


Hi, this is more of an earlier post regarding the strcmp function and my
problems with it on my Win98 machine.

This is the actual code I used for the strcmp function,


$errors=0;

if (empty($username)||empty($pword)||empty ($conf_pword)||empty($redirect))
 {
 echo "Please hit your browser's back button and fill in all
fields";
 $errors++;
 }

$comp=strcmp($conf_pword,$pword);
echo $comp;


The result ($comp) always comes back -1 when $pword is the 2nd variable, and
+1 when $pword is the 1st variable.  It doesn't matter what the input is
into the variables from the form the data comes from.  Is it comparing the
actual literals of the variable names?



-- 
PHP Database 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]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 11/01/02
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 11/01/02
 

-- 
PHP Database 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-DB] string compare function

2002-01-17 Thread matt stewart

take it you've tried having exactly the same value for each to test if the
return is 0?
it shouldn't be comparing literals, but it looks like it could well be!
try putting "" round the variables, and various things like that? 

-Original Message-
From: tomhilton [mailto:[EMAIL PROTECTED]]
Sent: 17 January 2002 15:20
To: [EMAIL PROTECTED]
Subject: [PHP-DB] string compare function 


Hi, this is more of an earlier post regarding the strcmp function and my
problems with it on my Win98 machine.

This is the actual code I used for the strcmp function,


$errors=0;

if (empty($username)||empty($pword)||empty ($conf_pword)||empty($redirect))
 {
 echo "Please hit your browser's back button and fill in all
fields";
 $errors++;
 }

$comp=strcmp($conf_pword,$pword);
echo $comp;


The result ($comp) always comes back -1 when $pword is the 2nd variable, and
+1 when $pword is the 1st variable.  It doesn't matter what the input is
into the variables from the form the data comes from.  Is it comparing the
actual literals of the variable names?



-- 
PHP Database 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]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 11/01/02
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 11/01/02
 

-- 
PHP Database 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-DB] string compare function

2002-01-17 Thread matt stewart

post the entire line of code, (and the surrounding couple of lines??
and we'll get more of an idea.

-Original Message-
From: tomhilton [mailto:[EMAIL PROTECTED]]
Sent: 17 January 2002 14:56
To: [EMAIL PROTECTED]
Subject: [PHP-DB] string compare function


Hi, I'm having a problem with the stcmp() function.  I have it comparing two
string variables, $pword and $conf_pword, in a script.  I know they both
have values, but the result always compares to 1 when $pword is the first
variable in the function, and -1 when $pword is the 2nd variable in the
function, no matter what string values are in the variables.  It seems like
the function is comparing the literal name "$pword" and "$conf_pword", not
their values.   I am working on a Win98 machine, does anyone have any
suggestions as to what I'm doing wrong?  Any help would be greatly
appreciated



-- 
PHP Database 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]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 11/01/02
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 11/01/02
 

-- 
PHP Database 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-DB] What is REG_BADRPT, and why do I get it?

2002-01-17 Thread matt stewart

It's not anything to do with the special regular expression characters again
is it?


-Original Message-
From: Beau Lebens [mailto:[EMAIL PROTECTED]]
Sent: 17 January 2002 01:38
To: 'Markus Lervik'; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] What is REG_BADRPT, and why do I get it?


on a guess - echo the value of $search_name in between each call to see what
happens to it as it goes through - you may find that something is going
haywire in there somewhere (or that it's blank)

-b

// -Original Message-
// From: Markus Lervik [mailto:[EMAIL PROTECTED]]
// Sent: Monday, 14 January 2002 9:42 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] What is REG_BADRPT, and why do I get it?
// 
// 
// 
// Hello!
// 
// I have quite a weird problem. When I use ereg or ereg_replace
// I get a REG_BADRPT warning, like so : 
// 
// Warning: REG_BADRPT in /var/www/html/mag/search.php on line 35
// Warning: REG_BADRPT in /var/www/html/mag/search.php on line 36
// 
// The offending lines are
// 
// if(ereg("*",$search_name)) { ereg_replace("*","%",$search_name); }
// if(ereg("?",$search_name)) { ereg_replace("?","_",$search_name); }
// 
// but just two lines above them I have
// 
// if(ereg("*",$search_id)) { ereg_replace("*","%",$search_id); }
// if(ereg("?",$search_id)) { ereg_replace("?","_",$search_id); }
// 
// and two similar lines of code below them, yet PHP doesn't complain 
// about them. Anyone have any ideas as to what's causing the warning?
// 
// 
// Cheers,
// Markus
// 
// -- 
// Markus Lervik
// Linux-administrator with a kungfoo grip
// Vaasa City Library - Regional Library
// [EMAIL PROTECTED]
// +358-6-325 3589 / +358-40-832 6709
// 
// -- 
// PHP Database 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 Database 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]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 11/01/02
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 11/01/02
 

-- 
PHP Database 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-DB] How can recommend a book for SQL and DB design

2002-01-16 Thread matt stewart

finished University nearly two years ago, but back then, this book was the
one we used too - very in depth introduction to general database theory,
well worth investing in if you need very well designed databases for large
volume applications.
all the best,
  Matt

-Original Message-
From: Leotta, Natalie (NCI/IMS) [mailto:[EMAIL PROTECTED]]
Sent: 16 January 2002 14:17
To: 'DL Neil'; 'Andy'; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] How can recommend a book for SQL and DB design


I'm a recent student but I sold back my DB text in hopes I'd never have to
know the stuff again (I guess that $20 wasn't worth it).  The current book
my old prof is using is:

Introduction to Database Systems, 7th Edition by C.J. Date. 

but since I don't know if that's the one I used I don't know if it's any
good.  I do know that the class covered the normalizations and things like
that.  It might be a good place to start, but it seems like college
textbooks are always at least twice the cost of normal books.

I haven't tried the PHP O'Reilly book, so thanks for the warning!

-Natalie

> -Original Message-
> From: DL Neil [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, January 15, 2002 5:34 PM
> To:   Leotta, Natalie (NCI/IMS); 'Andy'; [EMAIL PROTECTED]
> Subject:  Re: [PHP-DB] How can recommend a book for SQL and DB design
> 
> Andy (and Natalie),
> 
> In fact the O'Reilly book on PHP is the exception that might well prove
> the rule - normally I think them v.good
> 
> The reference work on MySQL is by Paul DuBois (who often stops by here -
> "hi Paul") and published by New Riders.
> 
> Unfortunately none of my favorite texts (of the moment) go into the
> background of db theory, eg normalisation.
> Perhaps one of the (recent) students on the list can help with that one...
> 
> Regards,
> =dn
> 
> 
> - Original Message -
> From: "Leotta, Natalie (NCI/IMS)" <[EMAIL PROTECTED]>
> To: "'Andy'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: 15 January 2002 22:14
> Subject: RE: [PHP-DB] How can recommend a book for SQL and DB design
> 
> 
> > Any O'Reilly book is always a good choice.  O'Reilly is the publisher -
> they
> > do the "Nutshell" books and a bunch of others.  They are also the books
> with
> > animals on them, if that helps :-)
> >
> > -Natalie
> >
> > > -Original Message-
> > > From: Andy [SMTP:[EMAIL PROTECTED]]
> > > Sent: Tuesday, January 15, 2002 5:11 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: [PHP-DB] How can recommend a book for SQL and DB design
> > >
> > > Hi,
> > >
> > > I am searching for a good book on how to design a db for web apps.
> > > Normalisation rools, performancejust describing how to do it on a
> > > proffesional way.
> > >
> > > The second one, I am searching for is a book about SQL for MySQL. Any
> good
> > > books on the market?
> > >
> > > Thanx for the recommendation
> > >
> > > Andy
> > >
> > >
> > >
> > > --
> > > PHP Database 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 Database 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 Database 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]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 11/01/02
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.314 / Virus Database: 175 - Release Date: 11/01/02
 

-- 
PHP Database 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-DB] Replacing * with %

2002-01-15 Thread matt stewart

excellent! two ways to do it - Markus confirmed that [*] works too - so
don't know which is better, but we have two solutions anyway.

-Original Message-
From: Rosser, Chris [mailto:[EMAIL PROTECTED]]
Sent: 15 January 2002 10:54
To: '[EMAIL PROTECTED]'
Subject: RE: [PHP-DB] Replacing * with %


The following works fine for me:

$currentword = ereg_replace("\*","%",$currentword);

Chris
}:)

> -----Original Message-
> From: matt stewart [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, January 15, 2002 9:57 AM
> To:   [EMAIL PROTECTED]
> Subject:  RE: [PHP-DB] Replacing * with %
> 
> just checked it out, and * is a special character unless enclosed in class
> brackets.
> so using "[*]" should hopefully work!
> give it a go and see.
> cheers,
>   Matt
> 
> -Original Message-
> From: matt stewart [mailto:[EMAIL PROTECTED]]
> Sent: 15 January 2002 09:54
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP-DB] Replacing * with %
> 
> 
> /* sorry markus, forgot to post this to the list, so here it is again! */
> 
> 
> don't know if this is the solution without doing some reading, so i'll
> tell
> you what i think it might be and you can read up on it!
> is either (or both?) * and % special characters in regular expressions? if
> so, it may be possible to delimit them with slashes, that would be my
> thinking anyway.
> Let me know if i'm right or (more likely) wrong!
> cheers,
> 
> Matt
> 
> -Original Message-
> From: Markus Lervik [mailto:[EMAIL PROTECTED]]
> Sent: 15 January 2002 09:40
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] Replacing * with %
> 
> 
> Hello all!
> 
> I can't for the love of god get neither ereg_replace nor str_replace
> to work. I wan't to replace * with % so I can use SELECT ... WHERE
> whatever LIKE "string%" in MySQL.
> 
> I've tried ereg_replace("*","%",$search_name). Didn't work.
> I tried escaping the asterisk. I tried double-escaping the asterisk.
> I  tried str_replace("*","%",$search_name), and that didn't work
> either. I tried just about everything I could think of, escaping, double-
> escaping and triple-escaping ad nauseum, but it just wont work.
> 
> Oh, yes, I also tried $search_name=ereg_replace(blablabla);
> What a surprise. It didn't work.
> 
> Yes, I've RTFM, RTMFM, read from my PHP Blackbook to phpbuilder.net
> and just about everything in between.
> 
> Pretty soon I'll start bashing away on that Solaris 8 box over there.
> 
> 
> Markus - frustrated
> 
> -- 
> Markus Lervik
> Linux-administrator with a kungfoo grip
> Vaasa City Library - Regional Library
> [EMAIL PROTECTED]
> +358-6-325 3589 / +358-40-832 6709
> 
> -- 
> PHP Database 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]
> 
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.313 / Virus Database: 174 - Release Date: 02/01/02
>  
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.313 / Virus Database: 174 - Release Date: 02/01/02
>  
> 
> -- 
> PHP Database 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]
> 
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.313 / Virus Database: 174 - Release Date: 02/01/02
>  
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.313 / Virus Database: 174 - Release Date: 02/01/02
>  
> 
> -- 
> PHP Database 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 Database 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]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.313 / Virus Database: 174 - Release Date: 02/01/02
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.313 / Virus Database: 174 - Release Date: 02/01/02
 

-- 
PHP Database 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-DB] Replacing * with %

2002-01-15 Thread matt stewart

just checked it out, and * is a special character unless enclosed in class
brackets.
so using "[*]" should hopefully work!
give it a go and see.
cheers,
  Matt

-Original Message-----
From: matt stewart [mailto:[EMAIL PROTECTED]]
Sent: 15 January 2002 09:54
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Replacing * with %


/* sorry markus, forgot to post this to the list, so here it is again! */


don't know if this is the solution without doing some reading, so i'll tell
you what i think it might be and you can read up on it!
is either (or both?) * and % special characters in regular expressions? if
so, it may be possible to delimit them with slashes, that would be my
thinking anyway.
Let me know if i'm right or (more likely) wrong!
cheers,

Matt

-Original Message-
From: Markus Lervik [mailto:[EMAIL PROTECTED]]
Sent: 15 January 2002 09:40
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Replacing * with %


Hello all!

I can't for the love of god get neither ereg_replace nor str_replace
to work. I wan't to replace * with % so I can use SELECT ... WHERE
whatever LIKE "string%" in MySQL.

I've tried ereg_replace("*","%",$search_name). Didn't work.
I tried escaping the asterisk. I tried double-escaping the asterisk.
I  tried str_replace("*","%",$search_name), and that didn't work
either. I tried just about everything I could think of, escaping, double-
escaping and triple-escaping ad nauseum, but it just wont work.

Oh, yes, I also tried $search_name=ereg_replace(blablabla);
What a surprise. It didn't work.

Yes, I've RTFM, RTMFM, read from my PHP Blackbook to phpbuilder.net
and just about everything in between.

Pretty soon I'll start bashing away on that Solaris 8 box over there.


Markus - frustrated

-- 
Markus Lervik
Linux-administrator with a kungfoo grip
Vaasa City Library - Regional Library
[EMAIL PROTECTED]
+358-6-325 3589 / +358-40-832 6709

-- 
PHP Database 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]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.313 / Virus Database: 174 - Release Date: 02/01/02
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.313 / Virus Database: 174 - Release Date: 02/01/02
 

-- 
PHP Database 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]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.313 / Virus Database: 174 - Release Date: 02/01/02
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.313 / Virus Database: 174 - Release Date: 02/01/02
 

-- 
PHP Database 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-DB] Replacing * with %

2002-01-15 Thread matt stewart

/* sorry markus, forgot to post this to the list, so here it is again! */


don't know if this is the solution without doing some reading, so i'll tell
you what i think it might be and you can read up on it!
is either (or both?) * and % special characters in regular expressions? if
so, it may be possible to delimit them with slashes, that would be my
thinking anyway.
Let me know if i'm right or (more likely) wrong!
cheers,

Matt

-Original Message-
From: Markus Lervik [mailto:[EMAIL PROTECTED]]
Sent: 15 January 2002 09:40
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Replacing * with %


Hello all!

I can't for the love of god get neither ereg_replace nor str_replace
to work. I wan't to replace * with % so I can use SELECT ... WHERE
whatever LIKE "string%" in MySQL.

I've tried ereg_replace("*","%",$search_name). Didn't work.
I tried escaping the asterisk. I tried double-escaping the asterisk.
I  tried str_replace("*","%",$search_name), and that didn't work
either. I tried just about everything I could think of, escaping, double-
escaping and triple-escaping ad nauseum, but it just wont work.

Oh, yes, I also tried $search_name=ereg_replace(blablabla);
What a surprise. It didn't work.

Yes, I've RTFM, RTMFM, read from my PHP Blackbook to phpbuilder.net
and just about everything in between.

Pretty soon I'll start bashing away on that Solaris 8 box over there.


Markus - frustrated

-- 
Markus Lervik
Linux-administrator with a kungfoo grip
Vaasa City Library - Regional Library
[EMAIL PROTECTED]
+358-6-325 3589 / +358-40-832 6709

-- 
PHP Database 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]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.313 / Virus Database: 174 - Release Date: 02/01/02
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.313 / Virus Database: 174 - Release Date: 02/01/02
 

-- 
PHP Database 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-DB] grabbing id from new record

2002-01-14 Thread matt stewart

straight after you do the insert command, use the call:
$ID = mysql_insert_id();

The $ID is now the primary key for the record you just inserted.


-Original Message-
From: George Pitcher [mailto:[EMAIL PROTECTED]]
Sent: 14 January 2002 14:56
To: Ireneusz Piasecki; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] grabbing id from new record


I am sorry, I was not clear in my original request.

The id is auto-incremented. I want to grab the id so that I can use it as
part of a redirect


 $q2="select Course_ID from course where HEI_ID = '$inst' order by Course_ID
desc limit 0,1";
 $result2=mysql_query($q2) or die("q2 failed");
 while ($row = mysql_fetch_array ($result2))
 {
 $recid=$row['Course_ID'];
 }
 $redirect=('Location: http://localhost/Mysite/itemlist.php?recid=' .
$recid);
 header($redirect);

As I said, it works but maybe there's a better way.

George

> What about Auto_increemnt field ??
> Your's id can be auto_increment field. for example:
> create table dupencja (id int(7) auto_increment not null, primary
key(id));
>
> so when you insert records:
> insert into dupencja values('') - > id will be 1
> insert into dupencja values('') - > id will be 2
>
> this is auto_increment, so your trick isn't need.
>
> More in manula of mysql.
> regards.
>  I piasecki - www.b-c.pl
>
>
>
>
> - Original Message -
> From: "George Pitcher" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, January 14, 2002 3:23 PM
> Subject: [PHP-DB] grabbing id from new record
>
>
> > Hi,
> >
> > Is there a way to grab the ID (from ID field) while INSERTing a new
> record?
> >
> > I am currently doing a separate INSERT then a SELECT query to find the
> most
> > recently added record by that user:
> >
> > select ID from table where user = '$user' order by ID DESC limit 0,1
> >
> > This does the trick but it may not be the most efficient way.
> >
> > George
> >
> >
> > ---
> > Outgoing mail is certified Virus Free.
> > Checked by AVG anti-virus system (http://www.grisoft.com).
> > Version: 6.0.307 / Virus Database: 168 - Release Date: 11/12/01
> >
> >
> > _
> > Do You Yahoo!?
> > Get your free @yahoo.com address at http://mail.yahoo.com
> >
> >
> > --
> > PHP Database 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]
> >
>
>
>
> --
>
> Znudzilo Ci sie logo w komorce?
> Wgraj nowe [ http://komorki.onet.pl/dodatki.html ]


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.307 / Virus Database: 168 - Release Date: 11/12/01


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP Database 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]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.313 / Virus Database: 174 - Release Date: 02/01/02
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.313 / Virus Database: 174 - Release Date: 02/01/02
 

-- 
PHP Database 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-DB] RE: LIMIT and get_num_rows

2002-01-14 Thread matt stewart

yep, it returns 20.

-Original Message-
From: DL Neil [mailto:[EMAIL PROTECTED]]
Sent: 14 January 2002 14:17
To: matt stewart; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] RE: LIMIT and get_num_rows


Have you (original post-er) tested performing a SELECT ... LIMIT 0, 20 and
then calling mysql_num_rows()?
Does it return 20 (the LIMIT) or the number of rows SELECT-ed before/without
regard to the limit?

=dn

- Original Message - 
From: "matt stewart" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: 14 January 2002 14:05
Subject: RE: [PHP-DB] RE: LIMIT and get_num_rows


> you've assumed correctly - so it's definitely faster to do the two
queries?
> okey dokey, then that's the method i shall use.
> thanks to everyone who's added their thoughts!
> 
> -Original Message-
> From: Peter Westergaard [mailto:[EMAIL PROTECTED]]
> Sent: 14 January 2002 14:01
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] RE: LIMIT and get_num_rows
> 
> 
> 
> >but presumably if i'm doing a SELECT count(*) FROM Designs WHERE Keywords
> >LIKE "%sport%"
> >followed by a SELECT * FROM Designs WHERE Keywords LIKE "%sport%" LIMIT
> 0,20
> >
> >it's still using nearly as much processing time as just returning all the
> >designs and just using a get_num_rows and then only using the first 20?
> 
> I absolutely think it will not.
> 
> After all, the table record count should be able to reference the index, 
> (you are running this query against an indexed 'Keywords' column yes?), 
> while assembling the table of returned data will take quite a bit more 
> memory, which is what you're really trying to cut down, I think.
> 
> Cheers,
> -Peter
> 
> 
> -- 
> PHP Database 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]
> 
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.313 / Virus Database: 174 - Release Date: 02/01/02
>  
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.313 / Virus Database: 174 - Release Date: 02/01/02
>  
> 
> -- 
> PHP Database 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]
> 
> 

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.313 / Virus Database: 174 - Release Date: 02/01/02
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.313 / Virus Database: 174 - Release Date: 02/01/02
 

-- 
PHP Database 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-DB] RE: LIMIT and get_num_rows

2002-01-14 Thread matt stewart

you've assumed correctly - so it's definitely faster to do the two queries?
okey dokey, then that's the method i shall use.
thanks to everyone who's added their thoughts!

-Original Message-
From: Peter Westergaard [mailto:[EMAIL PROTECTED]]
Sent: 14 January 2002 14:01
To: [EMAIL PROTECTED]
Subject: [PHP-DB] RE: LIMIT and get_num_rows



>but presumably if i'm doing a SELECT count(*) FROM Designs WHERE Keywords
>LIKE "%sport%"
>followed by a SELECT * FROM Designs WHERE Keywords LIKE "%sport%" LIMIT
0,20
>
>it's still using nearly as much processing time as just returning all the
>designs and just using a get_num_rows and then only using the first 20?

I absolutely think it will not.

After all, the table record count should be able to reference the index, 
(you are running this query against an indexed 'Keywords' column yes?), 
while assembling the table of returned data will take quite a bit more 
memory, which is what you're really trying to cut down, I think.

Cheers,
-Peter


-- 
PHP Database 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]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.313 / Virus Database: 174 - Release Date: 02/01/02
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.313 / Virus Database: 174 - Release Date: 02/01/02
 

-- 
PHP Database 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-DB] LIMIT and get_num_rows

2002-01-14 Thread matt stewart

but presumably if i'm doing a SELECT count(*) FROM Designs WHERE Keywords
LIKE "%sport%"
followed by a SELECT * FROM Designs WHERE Keywords LIKE "%sport%" LIMIT 0,20
 
it's still using nearly as much processing time as just returning all the
designs and just using a get_num_rows and then only using the first 20?

-Original Message-
From: Jonatan Bagge [mailto:[EMAIL PROTECTED]]
Sent: 14 January 2002 11:00
To: matt stewart
Subject: Re: [PHP-DB] LIMIT and get_num_rows


First do a SELECT count(*) from tablename; 
This will get the number of entries... 

The rest should be simple... 


matt stewart wrote: 


hi guys, just looking for verification on this, as i don't think there's any

way to do it 

Basically, i want to return the results for a search, but only return the 
first 20 results from the start number given 
LIMIT $start, 20 
BUT... i'd like to have a page 1-whatever so if there are 65 results in 
total, then the first 20 will be shown, but there will be options to move to

pages 2,3 or 4. 
Obviously, if i use LIMIT, then it won't know that there are 65 in total, so

how would i get around this? do i just have to do the full query, and then 
only use the first 20 results in the results set? 
just becomes a bit of a problem if there are, say, 8000 results returned! 
would it just be best to return the first 200 using LIMIT, and do my pages 
for those, with a note that there are more than 200 results, and to refine 
the search criteria? 
Cheers, 
  Matt 


--- 
Outgoing mail is certified Virus Free. 
Checked by AVG anti-virus system ( HYPERLINK
"http://www.grisoft.com"http://www.grisoft.com). 
Version: 6.0.313 / Virus Database: 174 - Release Date: 02/01/02 
  


-- 
PHP Database Mailing List ( HYPERLINK
"http://www.php.net/"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]


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.313 / Virus Database: 174 - Release Date: 02/01/02



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.313 / Virus Database: 174 - Release Date: 02/01/02
 



[PHP-DB] LIMIT and get_num_rows

2002-01-14 Thread matt stewart

hi guys, just looking for verification on this, as i don't think there's any
way to do it

Basically, i want to return the results for a search, but only return the
first 20 results from the start number given
LIMIT $start, 20
BUT... i'd like to have a page 1-whatever so if there are 65 results in
total, then the first 20 will be shown, but there will be options to move to
pages 2,3 or 4.
Obviously, if i use LIMIT, then it won't know that there are 65 in total, so
how would i get around this? do i just have to do the full query, and then
only use the first 20 results in the results set?
just becomes a bit of a problem if there are, say, 8000 results returned!
would it just be best to return the first 200 using LIMIT, and do my pages
for those, with a note that there are more than 200 results, and to refine
the search criteria?
Cheers,
  Matt

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.313 / Virus Database: 174 - Release Date: 02/01/02
 

-- 
PHP Database 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-DB] MySQL Result Resource

2002-01-11 Thread matt stewart

shouldn't it be PASSWORD('madonna') ??

-Original Message-
From: Necro [mailto:[EMAIL PROTECTED]]
Sent: 11 January 2002 04:39
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] MySQL Result Resource


http://www.hotscripts.com/Detailed/4219.html  <<--- that is the script

But I cannot use crypt() on a winodws system. So I tried MD5, now I try
PASSWORD.

Any one got any idea how to make the script work with either of those??

Andrew

-Original Message-
From: Necro [mailto:[EMAIL PROTECTED]]
Sent: Friday, 11 January 2002 3:30 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] MySQL Result Resource


Daniel,

I had tried both with and without quotes. Neither work.

Without quotes I get:
select password, 1 as auth from acl where username='andrewd' and password =
PASSWORD(madonna)1054 : Unknown column 'madonna' in 'where clause'

Notice that madonna has not been crypted by the PASSWORD call either.

Andrew

-Original Message-
From: Daniel Barton [mailto:[EMAIL PROTECTED]]
Sent: Friday, 11 January 2002 2:40 PM
To: Necro
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] MySQL Result Resource


Andrew:

Don't put quotes around your MySQL function call.

i.e.

PASSWORD($password)

not

'PASSWORD($password)'

p.s. Looking at this thread, it seems like most of the errors you're
encountering have
nothing to do with md5() or password(), but with syntax, like placement of
quotes, or
whether they are single quotes or double quotes. I would suggest
experimenting with
the syntax a bit, to check out what's kosher, and what's not? Check out the
PHP
manual's sections on 'Resource id's - I think you may find it to be very
important to
understanding how PHP interacts with databases. Resource ids, which are
returned by
quite a few function calls, are not classic variables - they need to be
manipulated or
interpreted before you use them.

Cheers,
db



Necro wrote:

> Ok,
>
> I have tried to go to PASSWORD after none of the suggestions worked out.
>
> The current statement is:
> $arg = "select password, 1 as auth from acl where
username='$username' and
> password = 'PASSWORD($password)'";
>
> But the error I get now is:
> select password, 1 as auth from acl where username='andrewd' and password
=
> 'PASSWORD(madonna)'Resource id #2
>
> Any ideas?
>
> Andrew
>
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Friday, 11 January 2002 8:56 AM
> To: Necro; [EMAIL PROTECTED]
> Subject: RE: [PHP-DB] MySQL Result Resource
>
> Addressed to: "Necro" <[EMAIL PROTECTED]>
>   [EMAIL PROTECTED]
>
> ** Reply to note from "Necro" <[EMAIL PROTECTED]> Fri, 11 Jan 2002
> 03:41:43 +1100
> > select password, 1 as auth from acl where (username='andrewd' and
> > password=(163e06103a371fd95b21b4a849bb4b91))1064 : You have an error in
> your
> > SQL syntax near 'a371fd95b21b4a849bb4b91))' at line 1
> >
> > Does that help give any idea at all as to what the problem is?
> >
>
> There are no quotes around  "163e06103a371fd95b21b4a849bb4b91"  The
> error occurs where it does because '163e06103' is a valid exponential
> notation value for a nubmer, but having an 'a' follow it is not valid.
>
> My solution would be:
>
> $Pass = md5( whatever ); #  I don't care if you hash just the password
>  #  or the username and password as long as
>  #  you do it the same way as you entered
>  #  the passwords.
>
> mysql_query( "SELECT password, 1 AS auth " .
>  "FROM acl " .
>  "WHERE username = '$username' " .
>  "  AND password = '$Pass' " );
>
> But I question what you are doing returning password, so it might work
> as well as:
>
> mysql_query( "SELECT count(*) as Authorized " .
>  "FROM acl " .
>  "WHERE username = '$username' " .
>  "  AND password = '$Pass' " );
>
> This returns 0 or 1 in a field named Authorized depending on if the
> password matches or not.
>
> You might also want to look at the MySQL PASSWORD() function and not
> mess with md5 at all.
>
> Rick
>
> Rick Widmer
> Internet Marketing Specialists
> http://www.developersdesk.com
>
> --
> PHP Database 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 Database 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]

--
--
Dan Barton
Terrestrial Program Biologist
Asst. Data Manager
Point Reyes Bird Observatory
http://www.prbo.org
[EMAIL PROTECTED]
[EMAIL PROTECTED]



--
PHP Database 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 Database Mailin

RE: [PHP-DB] simple question

2002-01-10 Thread matt stewart

not tried it, but according to the manual, it should be something like..

SELECT * FROM Bands WHERE Name REGEXP "^[0-9]";

check out the relevant page and see what you think:
http://www.mysql.com/doc/S/t/String_comparison_functions.html

regards,
  Matt

-Original Message-
From: Barry Rumsey [mailto:[EMAIL PROTECTED]]
Sent: 10 January 2002 11:46
To: [EMAIL PROTECTED]
Subject: [PHP-DB] simple question



I have a colum with the numbers between 0-9 ( table is a list of bands  )eg.
2 live crew , 2pac , 1 maniacs also in this table Ihave normal names
like : abba , queen , police etc..

How would I query the table to list only the ones starting with numbers.

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.312 / Virus Database: 173 - Release Date: 31/12/01
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.312 / Virus Database: 173 - Release Date: 31/12/01
 

-- 
PHP Database 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-DB] mysql_num_rows

2002-01-08 Thread matt stewart

don't know if this makes a difference, but i've always used WHERE bookid =
'$bookid'"; - single quote round the $bookid variable - not sure if that's
the problem, or if it's just good practice?

-Original Message-
From: Ford, Mike [LSS] [mailto:[EMAIL PROTECTED]]
Sent: 08 January 2002 14:07
To: 'Gurhan Ozen'; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] mysql_num_rows


> -Original Message-
> From: Gurhan Ozen [mailto:[EMAIL PROTECTED]]
> Sent: 06 January 2002 20:10
> 
> I am pretty sure that the query is correct. here is the actual query:
>   $query="select  distinct(nodeid), nodename  
> from books where
> bookid=$bookid";
>   $result=mysql_query($query);
>   $num_results=mysql_num_rows($result);
> 

>   The funny thing is that if i write the same query without "where
> bookid=$bookid" then the mysql_num_rows works but with where 
> statement it
> doesn't.

Have you echoed $result to see what it contains?  My guess is that it
contains something unexpected which, when inserted into the query, causes it
to fail (or at least return no rows!).  Otherwise, I can see no reason for
the addition of the WHERE clause to cause this error.

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

-- 
PHP Database 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]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.312 / Virus Database: 173 - Release Date: 31/12/01
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.312 / Virus Database: 173 - Release Date: 31/12/01
 

-- 
PHP Database 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-DB] Formated Results

2002-01-07 Thread matt stewart

well, i'm sure there are lots out there, but i am very happy with...
"PHP and MySQL Web Development" By Luke Welling and Laura Thomson, published
by SAMS

First printed in March 2001, so it's still not out of date.
there are probably lots of other good books out there too though.

-Original Message-
From: Barry Rumsey [mailto:[EMAIL PROTECTED]]
Sent: 07 January 2002 12:32
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Formated Results


Yes thank you that was the answer.
While I'm asking questions , I've got one good one :
Whats the best book to buy on  php & mysql ?
- Original Message -
From: "Andrey Hristov" <[EMAIL PROTECTED]>
To: "Barry Rumsey" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, January 08, 2002 1:27 AM
Subject: Re: [PHP-DB] Formated Results


> Try printing  before and  after them
>
>
> Regards,
> Andrey Hristov
> - Original Message -
> From: "Barry Rumsey" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, January 07, 2002 2:19 PM
> Subject: [PHP-DB] Formated Results
>
>
> Hi
> I have a database that has lyrics in it. I can get them to list but they
are not aligned the same as whats in the database. How can
> I get the results aligned as whats in the database ?
>
>



-- 
PHP Database 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]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.312 / Virus Database: 173 - Release Date: 31/12/01
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.312 / Virus Database: 173 - Release Date: 31/12/01
 

-- 
PHP Database 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-DB] Formated Results

2002-01-07 Thread matt stewart

without code it's hard to know, but i'd have thought a simple html  tag
around the entry should work.
ie...
printf "%s",$myrow[Lyrics];

-Original Message-
From: Barry Rumsey [mailto:[EMAIL PROTECTED]]
Sent: 07 January 2002 12:20
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Formated Results


Hi
I have a database that has lyrics in it. I can get them to list but they are
not aligned the same as whats in the database. How can I get the results
aligned as whats in the database ?

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.312 / Virus Database: 173 - Release Date: 31/12/01
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.312 / Virus Database: 173 - Release Date: 31/12/01
 

-- 
PHP Database 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-DB] Fixed Quote Marks in Inputs

2002-01-07 Thread matt stewart

No! don't get them started again! my inbox won't take it
any more.

-Original Message-
From: Boaz Yahav [mailto:[EMAIL PROTECTED]]
Sent: 05 January 2002 08:07
To: Bogdan Stancescu; Jonathan Hilgeman
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Fixed Quote Marks in Inputs


I just read your thread and I have to say that I was intrigued both by
the subject (which is interesting) and by the different views you show.

I just have one question for Jonathan :

If you store the ' and " as ' and " what do you do if you need
to show the data later on in a non HTML format (text file for example).
Wouldn't you still need to convert back to ' and " before you show the
text?

Sincerely

  berber

Visit http://www.weberdev.com Today!!! 
To see where PHP might take you tomorrow.


-Original Message-
From: Bogdan Stancescu [mailto:[EMAIL PROTECTED]]
Sent: Saturday, January 05, 2002 1:44 AM
To: Jonathan Hilgeman
Cc: '[EMAIL PROTECTED]'
Subject: Re: [PHP-DB] Fixed Quote Marks in Inputs


Ok, seems like I misjudged you and I apologize for that.

I haven't changed my opinion about the very issue we've been discussing
- only
wanted to post the sentence above, just for the record.

Bogdan

Jonathan Hilgeman wrote:

> Apparently, the experienced way is to store them with slashes, which
is what
> I've followed for years. I consider years of programming to be a fair
amount
> of experience, thus qualifying me to be experienced. ANYHOW, after
finally
> thinking a bit outside the box and with some valuable input from some
> co-workers, we came up with this function which is a much more
efficient
> solution in this matter than the "experienced" way you proposed.
>
> My purpose in even posting this function was so that other people
could
> avoid having to go through the same problems I faced when using the
"proper"
> and apparently "experienced" method that I only used because I
listened to
> programmers like you (mind you, I said LIKE you, not YOU) who believe
in
> standard procedure in all cases without considering more efficient
options.


-- 
PHP Database 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 Database 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]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.312 / Virus Database: 173 - Release Date: 31/12/01
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.312 / Virus Database: 173 - Release Date: 31/12/01
 

-- 
PHP Database 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-DB] Re: Redirecting to a new page

2002-01-07 Thread matt stewart

yeah, i know this, but i'm just trying to get this to work before i add some
security in there - passing sessions through etc to ensure they're logged in
as admin etc.
it doesn't really have to be that secure for what i want anyway, but
probably a good job you pointed that out ;)

-Original Message-
From: Fred [mailto:[EMAIL PROTECTED]]
Sent: 04 January 2002 21:18
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Re: Redirecting to a new page


Please note, that this is a very insecure way of determining which page a
person gets to view.  All they would have to do is enter the admin.php url
in the browser and they get admin access even if they are not admins.

Fred

Matt Stewart <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Can't find the right instructions on php.net, basically, i want a page
where
> someone logs in, and then according to the database entry for them, either
> they are an admin user or a normal user, and it should then send them to a
> page depending on which they are.
> I've accessed the db ok, and checked which they are, then i've used
>
> if ($myrow[Admin] == "Y"){
> print "Location:admin.php";
> }else{
> print "Location:user.php";
> )
>
> this doesn't sem to work - just gives a blank screen with the standard
html
> headers and footers, rather than the desired location page.
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.312 / Virus Database: 173 - Release Date: 31/12/01
>



-- 
PHP Database 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]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.312 / Virus Database: 173 - Release Date: 31/12/01
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.312 / Virus Database: 173 - Release Date: 31/12/01
 

-- 
PHP Database 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-DB] Redirecting to a new page

2002-01-04 Thread matt stewart

Can't find the right instructions on php.net, basically, i want a page where
someone logs in, and then according to the database entry for them, either
they are an admin user or a normal user, and it should then send them to a
page depending on which they are.
I've accessed the db ok, and checked which they are, then i've used 

if ($myrow[Admin] == "Y"){
print "Location:admin.php";
}else{
print "Location:user.php";
)

this doesn't sem to work - just gives a blank screen with the standard html
headers and footers, rather than the desired location page.


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.312 / Virus Database: 173 - Release Date: 31/12/01
 

-- 
PHP Database 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-DB] Checkboxes, PHP, and MySQL

2001-12-20 Thread matt stewart

the value doesn't determine whether it's checked or not - it determines the
value passed WHEN it's checked.
try the lines below:
echo"";
}else{
echo">";
}
or something along these lines.

-Original Message-
From: SpyProductions Support Team [mailto:[EMAIL PROTECTED]]
Sent: 20 December 2001 16:40
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Checkboxes, PHP, and MySQL



I've looked around in a few of the PHP lists for an answer to this, but
can't come up with one.

Here's what I am doing:

I have a form with a few checkboxes.

When the information as to whether the checkboxes are checked or not is
'saved' into the MySQL table, they are represented by a value of '1' - fine.

When I want to edit this information, in the form of a similar form with
checkboxes, the boxes are not checked off if they were before.

What I am stuck on is how a checkbox can get checked off when pulling
information from the MySQL as an array.

Here's a line of code showing my array coming out.



$result is the array.

I guess what I am asking is that if a checkbox is assigned a value of one,
why doesn't it appear as already checked off?

Thanks,

-Mike


-- 
PHP Database 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]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.307 / Virus Database: 168 - Release Date: 11/12/01
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.307 / Virus Database: 168 - Release Date: 11/12/01
 

-- 
PHP Database 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-DB] Decrypting PASSWORD() from MySQL

2001-12-20 Thread matt stewart

good point well made.
this system has pretty much everything we need - thanks!

-Original Message-
From: Ryan Marrs [mailto:[EMAIL PROTECTED]]
Sent: 20 December 2001 16:17
To: 'Zach Curtis'; matt stewart
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Decrypting PASSWORD() from MySQL


Or what may be even better at that point (to keep someone from pestering
another user and changing their password.  Email them a randomly generated
string based on their username, store that in a database, then send them to
a page to enter the string (or pass it through the url.)

IE.

I'm Joe, I lost my password, I click Lost Password.  It emails me this:

http://this.domain.com/passwordreset.php?un=joe&gen=2lkfh4j2lk34klb25bmn425k
l23k5b

Then it will change my password to a randomly generated string and email it
to me.  
After that, it will allow me to change my password.

That way you don't have a schmuck in there guessing usernames, or pestering
people they don't like by clicking "Lost Password".  If someone doesn't
check their mail quite frequently, they'll just get "Incorrect Password" and
be emailing you for support every 5 minutes.



 Ryan Marrs
 Web Developer
 Sandler and Travis Trade Advisory Services, Inc.
 248.474.7200 x 183
 http://www.strtrade.com
 
 

-Original Message-
From: Zach Curtis [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, December 20, 2001 11:15 AM
To: matt stewart
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Decrypting PASSWORD() from MySQL

This is how I'm going to work things.

Store the password using PASSWORD() in the table. Allow user to request
their forgotten username and/or password. If the password is requested, I
will reset the password to a random value and store this in the table using
PASSWORD(). The username and/or password will then be emailed to the user. I
will also provide a location where the user can change their password once
they are authenticated in the members area.

I think this approach allows the password to maintain a certain level of
security and give the user the greatest flexibility on maintaining their
password.


Zach

-Original Message-
From: matt stewart [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 20, 2001 2:19 AM
To: 'Zach Curtis'; [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Decrypting PASSWORD() from MySQL


I would go for the "generate new random password" approach - email the new
random password to the registered email address, then they can log in using
it and reset it to whatever they want. probably easier than using lots of
code encrypting and decrypting things?
Let me know what you decide on, and if you do enc/decrypt stuff, i'd be
interested in seeing the code for a similar thing myself!
Matt

-Original Message-
From: Zach Curtis [mailto:[EMAIL PROTECTED]]
Sent: 19 December 2001 20:27
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Decrypting PASSWORD() from MySQL


Thanks for the suggestions.

I guess I can try to:

A) Store the password in plaintext if I need to retrieve the password.
B) Store the password using PASSWORD() and then generate a new random
password if needed, replacing the old password.
C) Look into mcrypt, ENCODE()/DECODE(), encipher/decipher

Thanks,


Zach

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 19, 2001 12:56 PM
To: Zach Curtis
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Decrypting PASSWORD() from MySQL


Yet another example of ted's out-to-lunchness...

Use the mcrypt functions on the password...




--
PHP Database 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]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.307 / Virus Database: 168 - Release Date: 11/12/01


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.307 / Virus Database: 168 - Release Date: 11/12/01



-- 
PHP Database 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 Database 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]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.307 / Virus Database: 168 - Release Date: 11/12/01
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.307 / Virus Database: 168 - Releas

RE: [PHP-DB] Decrypting PASSWORD() from MySQL

2001-12-20 Thread matt stewart

I would go for the "generate new random password" approach - email the new
random password to the registered email address, then they can log in using
it and reset it to whatever they want. probably easier than using lots of
code encrypting and decrypting things?
Let me know what you decide on, and if you do enc/decrypt stuff, i'd be
interested in seeing the code for a similar thing myself!
Matt

-Original Message-
From: Zach Curtis [mailto:[EMAIL PROTECTED]]
Sent: 19 December 2001 20:27
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Decrypting PASSWORD() from MySQL


Thanks for the suggestions.

I guess I can try to:

A) Store the password in plaintext if I need to retrieve the password.
B) Store the password using PASSWORD() and then generate a new random
password if needed, replacing the old password.
C) Look into mcrypt, ENCODE()/DECODE(), encipher/decipher

Thanks,


Zach

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 19, 2001 12:56 PM
To: Zach Curtis
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Decrypting PASSWORD() from MySQL


Yet another example of ted's out-to-lunchness...

Use the mcrypt functions on the password...




-- 
PHP Database 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]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.307 / Virus Database: 168 - Release Date: 11/12/01
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.307 / Virus Database: 168 - Release Date: 11/12/01
 

-- 
PHP Database 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-DB] Re: while...if statements???

2001-12-19 Thread matt stewart

and i always thought the best tactic was to go ugly early.

seriously, this isn't really that ugly a solution, most textbooks tend to
tell you to use this method to start with as its a bit simpler to understand
for beginners - an if...else statement to see if an initial row is returned,
then you can happily use a do...while on that first row, and it'll carry on
outputting the following rows if there are any more.

-Original Message-
From: Chris Lee [mailto:[EMAIL PROTECTED]]
Sent: 18 December 2001 20:49
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP-DB] Re: while...if statements???


because the while() statement works like this

- do something while x is true. if x is not true dont do anything.
- do something while conent is in the db. if there is no conent in the db
dont do anything.

your if() statement is never run if there is no content.

$return = mysql_fetch_row($result);
if ( isset($return['pet_name']) )
do
{
echo $return['pet_name'] ."";
} while( $return = mysql_fetch_row($result) );
else
echo " No Pets ";

its ugly but it works. I dont like ugly, so I wrote my own db wrappers.

http://www.mediawaveonline.com/examples/

foreach( $db->select_array('', 'petinfo', '') as $pos => $val )
echo $val['pet_name'] ."";
if ( !isset($val['pet_name']) )
echo " No Pets ";

I like that more. but whatever.

--

  Chris Lee
  [EMAIL PROTECTED]



"Jay Fitzgerald" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Does anyone know why this isn't working?? What I am trying to do is
display
> photos from a database based on each month. This part works fine when I
set
> it to the current month of December (today) as that is when I uploaded the
> photos.
>
> However, when I manually set the date to a month that has no photos in it,
> I want it to echo the No Animals string belowThis is only working
> half-way...meaning that it will display a blank page with nothing on it
> instead of actually echoing the No Animals string
>
> Can anyone please help?? Is there really a way to have a "while...if"
> statement
>
>
>
> =
>  $connection = mysql_connect($hostname, $user, $pass) or die ("Unable to
> connect!");
> $query = "SELECT petname, petDesc, petpicture FROM petinfo WHERE petmonth
=
> 'Apr'";
> $result = mysql_db_query($database, $query, $connection) or die ("Error in
> query: $query. " . mysql_error());
>
> while (list($pet_name, $pet_Desc, $pet_picture) =
mysql_fetch_row($result))
> {
> if ($pet_picture == "")
> {
> echo "No Animals have been posted for $date at this moment. Please check
> back soon.";
> exit;
> }
>
> else
> {
> echo "
> Pet of the month
>
> 
> 
SRC=\"http://moss.bayou.com:/oppj/admin/animalcontrol/photos/$pet_pictur
e\"
> HEIGHT=150>
>
> 
> $pet_Desc
>
> 
> To adopt $pet_name please visit the Ouachita Parish Animal Shelter.
> The adoption fee is \$50.00 which includes Spade, Neutering and 7-N-1
> Shot.
>
> 
> Sorry, we can not hold $pet_name for you (First come first serve
> basis).
> ";
> }
> }
> ?>
> =
>
> Thanks,
>
>
> Confus3d
>
>



-- 
PHP Database 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]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.307 / Virus Database: 168 - Release Date: 11/12/01
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.307 / Virus Database: 168 - Release Date: 11/12/01
 

-- 
PHP Database 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-DB] Re: Dynamically populating a dropdown box

2001-12-14 Thread matt stewart

yep, that's basically what i use for this sort of thing - it's a nice short
simple function, and works a treat. Obviously if you'd rather be passing the
actual colour name to the next step, you use printf("%s", $myrow["colorname"], $myrow["colorname"]);
I also prefer to use printf(" so it has the value in
quotes - just a fussy html thing i do though.

-Original Message-
From: Matthew Crouch [mailto:[EMAIL PROTECTED]]
Sent: 13 December 2001 22:58
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Re: Dynamically populating a dropdown box


I'm no expert, and my code is probably buggy, but I think this is the gist
of it:


%s", $myrow["colorid"],
$myrow["colorname"]);
}
?>



Chris Payne wrote:

> Hi there everyone,
>
> I have a shopping cart which is starting to work nicely, but I have to
select size/color from the entries, how do I do this dynamically in PHP with
MySQL?  I need them to be dropdown form boxes but haven't got a clue how to
populate them from the fields of my database.
>
> Please help me with example code if possible, it would be greatly
appreciated :-)
>
> Thank you everyone
>
> Regards
>
> Chris


-- 
PHP Database 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]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.306 / Virus Database: 166 - Release Date: 04/12/01
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.306 / Virus Database: 166 - Release Date: 04/12/01
 

-- 
PHP Database 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-DB] parse error

2001-12-14 Thread matt stewart

the way to start this is to just add a couple of letters to the message and
see if you're still getting an error - 
try (on line 357)...

$message .=">no\nHello world";
keep it all on one line, and then see if you're still getting an error - if
you are then i don't think this line is the one you have to worry about!

-Original Message-
From: Rob Day [mailto:[EMAIL PROTECTED]]
Sent: 13 December 2001 21:49
To: '[EMAIL PROTECTED]'
Subject: [PHP-DB] parse error


I've written a small script that processes a form from a webpage and sends
the submitted data as an HTML e-mail that has the form all filled out
already. I've gotten smaller versions of this script to work without any
problem just to test the idea.I can't figure out why I'm now getting the
following error:
Parse error: parse error in /home/httpd/cgi-bin/rday/lists/do_listapp.php3
on line 358

Here is the offending code:
353 if ($moderation == "no"){
354 $message .= " checked";
355 }
356
357$message .= '
358>no
359Answer "yes" if you want all postings to the list to be
sent to 
360  a moderator for approval before distribution to the
list.

Any help would be greatly appreciated. Thanks!

Rob Day
Web Team Leader
Texas State Library and Archives Commission
phone: 512.936.4463   fax: 512.463.5436
[EMAIL PROTECTED]


-- 
PHP Database 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]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.306 / Virus Database: 166 - Release Date: 04/12/01
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.306 / Virus Database: 166 - Release Date: 04/12/01
 

-- 
PHP Database 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-DB] Problem with MySQL and array loop

2001-12-13 Thread matt stewart

you're only printing stuff while i=0, i=1,i=6.
therefore only 7 things come out.
either make the loop for($i=0;$i<=7;$i++), or for($i=0;$i<8;$i++).

-Original Message-
From: +markus lervik [mailto:[EMAIL PROTECTED]]
Sent: 13 December 2001 09:37
To: php-db
Subject: [PHP-DB] Problem with MySQL and array loop



Hello,

I've got a really strange problem.

When looping through a result given by mysql_fetch_row(),
the code for some reason ignores the last column in the database.

The code snippet I'm using now is


while($row=mysql_fetch_row($result)) {

print("");

for($i=0;$i<7;$i++) {
print("");
if($row[$i]=="") {
print("N/A");
}
else {
printf("%s", $row[$i]);
}
print("");
}
print("");
}

The database has got eight columns, and I can't for the world figure
out why it doesn't work. I have exactly the same problem with another
PHP-app that I'm developing, too, so if someone has got a solution to
my problem, I'd probably get the other app working too.

What is it I'm missing, or am I just stupid?
I opt for the second choice. :)


Cheers,
Markus


-- 
Markus Lervik
Linux-administrator with a kungfoo grip
Vaasa City Library - Regional Library
[EMAIL PROTECTED]
+358-6-325 3589 / +358-40-832 6709


-- 
PHP Database 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]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.306 / Virus Database: 166 - Release Date: 04/12/01
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.306 / Virus Database: 166 - Release Date: 04/12/01
 

-- 
PHP Database 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-DB] WAS: Use php to plot graph. NOW: ASCII GRAPH CONTEST

2001-12-04 Thread matt stewart

we could even give an "i love linux" t-shirt to the winner of the contest!

-Original Message-
From: Daniel Barton [mailto:[EMAIL PROTECTED]]
Sent: 03 December 2001 17:00
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] WAS: Use php to plot graph. NOW: ASCII GRAPH
CONTEST



The method I used for ascii graphs was based on some C program I wrote that
created an array, which was, in essence, the graph. Each array element was
two
characters wide (we''l see why..) The first column of the array is all |, to
make
a Y axis, and the last row if the array is all _, to make an X axis. Then
there
were two other arrays, for labels, that were stuck along side or below the
axes
(dynamic). The first array is modified based on the data, using O, -, |, \
and /
in goofy combinations to draw lines. Then I characterized characters
(heehee) as
either wide, or narrow, to avoid width problems, and when it's a "narrow"
character you insert a space to avoid problems with lines not lining up.
Then,
spit the array out to the display. Whhe fun.

We should have an "ASCII/PHP/Database Graphing Contest." I'll host it if
there
are interested contestants. Suggested design: HTML form for data input,
passes to
PHP script for immediate (and STYLIN') ascii output. Any takers?

Will post the code/output example when I have a free moment...

Bas Jobsen wrote:

> Hi,
>
> > 4) Program some really slick ascii graphs. No joke, I did this a while
ago.
> > Nice output. Really fast. You can do line graphs, too.
>
> Intressting. Do you have an example?
>
> Tnx,
>
> Bas
>
>

--
--
Dan Barton
Terrestrial Program Biologist
Asst. Data Manager
Point Reyes Bird Observatory
http://www.prbo.org
[EMAIL PROTECTED]
[EMAIL PROTECTED]



-- 
PHP Database 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]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.303 / Virus Database: 164 - Release Date: 24/11/01
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.303 / Virus Database: 164 - Release Date: 24/11/01
 

-- 
PHP Database 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-DB] Use php to plot graph.

2001-12-03 Thread matt stewart

yes, it is possible - read up on the .PNG image format, as it is possible to
create graphs ind images dynamically to suit the data and figures youve
extracted from the database

-Original Message-
From: Denny Ow [mailto:[EMAIL PROTECTED]]
Sent: 03 December 2001 16:14
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Use php to plot graph.


Hi,

Jus wanna to ask if it is possible to use php to plot graph using data
retrieve from mysql. If yes, how should i go about?

Thanks,
Denny


-- 
PHP Database 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]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.303 / Virus Database: 164 - Release Date: 24/11/01
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.303 / Virus Database: 164 - Release Date: 24/11/01
 

-- 
PHP Database 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-DB] get the record id of the last addition in a table

2001-11-27 Thread matt stewart

$last_add = mysql_insert_id();
- thanks to Bruno Gimenes Pereti who answered this very same question when i
asked it a couple of weeks ago ;)

all the best,
  Matt


-Original Message-
From: LeTortorec, Jean-Louis [mailto:[EMAIL PROTECTED]]
Sent: 26 November 2001 22:22
To: '[EMAIL PROTECTED]'
Subject: [PHP-DB] get the record id of the last addition in a table


Hi:
 
I've created a table. The fields are "id" (auto-increment, integer),
"field1","field2),...
 
When I do "insert into mytable (field1..) values (...)", how to get in
return the value of "id"?
 
Thanks
 
 
 
Jean-Louis

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
 

-- 
PHP Database 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-DB] Combination of SQL statements invalid in MySQL?

2001-11-22 Thread matt stewart

never tried this before, but do you need some single quote's around the
whole "(select user_id.)"?
then of course there'd need to be some escape character for the single
quotes in the "user_name = 'herbert01'" bit...
let me know if that is the problem, as this is just a guess!
cheers,
  Matt

-Original Message-
From: Andy [mailto:[EMAIL PROTECTED]]
Sent: 22 November 2001 15:09
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Combination of SQL statements invalid in MySQL?


Hi there,

I am trying to do a combination of SQL statements like described in a SQL
bóok. Is it possible, that mysql does not allow this syntax?

Thanx Andy

Error:

Occured during executing DELETE FROM test_user_interests WHERE user_id =
(SELECT user_id FROM test_user WHERE user_name = 'herbert01') statement

Error: 1064 You have an error in your SQL syntax near 'SELECT user_id FROM
test_user WHERE user_name = 'herbert01') ' at line 3



-- 
PHP Database 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]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
 

--
PHP Database 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-DB] New to PHP and MySQL!!!

2001-11-22 Thread matt stewart

i'd advise not using something like ultradev until you can write some nice
little scripts in notepad! it's always easier to debug if you start learning
the code properly, then move onto something like ultradev just to speed it
up a bit when you're competent.
firstly, the actual extraction of code from a database is easy - just look
up how to connect, create a simple sql statement, and  get some results
using it.
the first thing to do is to get your MySQL database set up though.
are you telnetting in to the server to seet it up, or running a server on
you local machine?
let us know how it's all set up first!

-Original Message-
From: Oli Wilkinson [mailto:[EMAIL PROTECTED]]
Sent: 22 November 2001 15:02
To: [EMAIL PROTECTED]
Subject: [PHP-DB] New to PHP and MySQL!!!


Hello all,

I'm new to this database stuff  - I'm looking to create a simple database in
MySQL for a news page.

Just want the date of the input and the text for each entry!

Not too hard! But I'm a complete novice!!!

I am using Dreamweaver UltraDev (and the PHP extension).

Many Thanks

Oli Wilkinson



-- 
PHP Database 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]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
 

-- 
PHP Database 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-DB] Upload

2001-11-16 Thread matt stewart

always make sure you restrict what can be uploaded though! only allow file
extensions that you know are safe! otherwise people might do nasty things to
your server!

-Original Message-
From: Jonathan Hilgeman [mailto:[EMAIL PROTECTED]]
Sent: 16 November 2001 16:29
To: 'Lilian Salazar'; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Upload


Hola Lilian,
You might want to check http://phpclasses.upperdesign.com and search for
"upload."

- BUT -

I have found it much easier and simpler to just to use my own code when
doing uploads. It is really simple, since most of the work is done by the
browser and the server programs. To add an upload function just create 2
pages:

---
page1.html  (Can be located anywhere, even on your desktop)
http://www.mysite.com/page2.php";
METHOD="POST">



---


---
page2.php   (Should be at http://www.mysite.com/page2.php)

---

- Jonathan

-Original Message-
From: Lilian Salazar [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 16, 2001 8:09 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Upload


Hi,

  Exists some component that allows to do upload from archives to the
  Web server? Where it could find it? Somebody knows?
  The ideal would be that it served so much for Apache as for IIS. The
  Database is Oracle 8i
  Thank you very much.

-- 
Saludos,
 Lilian  mailto:[EMAIL PROTECTED]


-- 
PHP Database 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 Database 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]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
 

-- 
PHP Database 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-DB] Converting Date Form Fields

2001-11-16 Thread matt stewart

put them into an array
$date_stuff[0] = $date_year;
$date_stuff[1] = $date_month;
$date_stuff[2] = "01";
$date_to_enter = join('-',$date_stuff);
then whack $date_to_enter into your database - obviously if the input to
$date_month is "Jan", you need a case statement, or something like that to
make sure you change it to "01".

Hope it helps ;)
Matt


-Original Message-
From: Zach Curtis [mailto:[EMAIL PROTECTED]]
Sent: 16 November 2001 16:02
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Converting Date Form Fields


I have two HTML form fields birthMonth (e.g., Jan=1, Feb=2...) and birthYear
(e.g., 2001=2001, 1999=1999...). How can take these two individual form
fields, then add in a default value of "1" for the birthDay (this is not
asked in the form), and put this data into a MySQL table field birthDate
with field type DATE (-MM-DD)? The part I do not know how to accomplish
is taking these form fields and then combining them into a date
field/format.

Thank you.


Zach Curtis
POPULUS


-- 
PHP Database 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]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
 

-- 
PHP Database 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-DB] help me on projecting some tables

2001-11-16 Thread matt stewart

yep, that first example was roughly what i was getting at, don't think i
explained it anywhere near as well as Rick though.

-Original Message-
From: Rick Emery [mailto:[EMAIL PROTECTED]]
Sent: 16 November 2001 14:17
To: PHP DB
Subject: RE: [PHP-DB] help me on projecting some tables


Carlo,

Your question is the reason for the invention of the relational database.
Please do NOT add columns for "planned expansion".  How many extra columns
would you need? 4? 10? 25? 100?  Such a schema is wasteful of storage.

There are several ways to go about this.  For example:

CREATE TABLE products(
product_id int auto_increment primary key,
description char(50) default "",
quantity int not null,
unit enum ("each","lb","ounce","gallon","quart"),
price decimal(5,2) not null
)

CREATE TABLE traits(
characteristic char(25) default "",
product_id int,
description char(25)
)

In the above example, when you wanted to add  a characteristic for a
particular product, you simply add a record into traits and set
traits.product_id equal to products.product_id.  This will make it REAL EASY
doing joins on this combo as well.  For example:

INSERT INTO products VALUES(NULL, "Coca Cola",1,"ounce",0.39);
INSERT INTO traits  VALUES("Liquid",LAST_INSERT_ID(),"Seltzer-based");
INSERT INTO traits  VALUES("Added Chemicals",LAST_INSERT_ID(),"Sugar");
INSERT INTO traits  VALUES("Added Chemicals",LAST_INSERT_ID(),"Brown Dye");
INSERT INTO traits  VALUES("Added Chemicals",LAST_INSERT_ID(),"Caramel
coloring");

To get all the characteristics for a given product:
SELECT * FROM products LEFT JOIN traits  USING(product_id) ORDER BY
char_1.characteristic

In another example, if multiple products will come in multiple styles, you
would create a table called STYLES and insert a record for each style
available:

CREATE TABLE styles(
color char(10) default "",
product_id int,
)

INSERT INTO products VALUES(NULL,"Bread",1,"each",1.49);
INSERT INTO styles VALUES( "White",LAST_INSERT_ID() );
INSERT INTO styles VALUES( "Black",LAST_INSERT_ID() );
INSERT INTO styles VALUES( "Wheat",LAST_INSERT_ID() );
INSERT INTO styles VALUES( "Hawaiian",LAST_INSERT_ID() );

-Original Message-
From: matt stewart [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 16, 2001 5:55 AM
To: 'Carlo Loiudice'; PHP DB
Subject: RE: [PHP-DB] help me on projecting some tables


not really sure how to do this, other than planning for as much as you can
in your original tables, then have a spare table with four columns - Row_ID,
Characteristic_Name, Characteristic_Value, and Product_Refer_ID.
so then if you get a new characteristic (eg colour) then you could have
values 1, colour, blue, 4(the product with this characteristic).
then the next line might be 2,colour,green,8
then 2,density,45kg/m3,8

etc.
not sure this is the best way, but the only way i can think of to have
various additional characteristics for some products.
hope it helps??
Matt

-Original Message-
From: Carlo Loiudice [mailto:[EMAIL PROTECTED]]
Sent: 16 November 2001 10:48
To: PHP DB
Subject: [PHP-DB] help me on projecting some tables


Hi,
I've to store in a BD some alimentary product, and
there are lot of informations like chemical, physical,
nutritional characteristics , ...
I don't know how to store this info.
So I've a lot of product with a lot of corresponding
characteristics.

I've thought about to create a table where to store
all chemical characteristics, a table for nutritional,
ecc. and put in the product table the refer ID to all
this caracteristic tables. 
But in this way, there's the problem that now I'm
storing 3 chemical charact. but tomorrow I'd like to
add a new charact., and I wouldn't change tha table
structure adding a new column every time I've a new
field that I haven't expected.

Can someone show me the right strategy to resolve this
kind of problem?

Ciao, Carlo

__

Abbonati a Yahoo! ADSL con Atlanet!
Naviga su Internet ad alta velocità, e senza limiti di tempo! 
Per saperne di più vai alla pagina http://adsl.yahoo.it

-- 
PHP Database 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]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
 

-- 
PHP Database Mailing List (http://www

RE: [PHP-DB] PHP results bold in HTML

2001-11-16 Thread matt stewart

I would start by checking the html tags - you've got a class call for the
table - check the stylesheet at the top of the document to see if it's
saying in class "table.db1" the text is all bold.
also, you seem to have some stray tags - surely the  start tag should
end eith a  rather than a ?
and  at the bottom of the code there are some  tags - there don't seem
to be any  start tags, so you can probably get rid of those too.
see if that helps at all, then post again if there are still problems with
the new code.

-Original Message-
From: Kevin Schaaps [mailto:[EMAIL PROTECTED]]
Sent: 16 November 2001 11:53
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] PHP results bold in HTML


Thanks Matt,

Here it is:

mysql_select_db ($dbname);

// -
--
//  FLEET LIST
// -
--
$query = "SELECT sim_tbl.name as SimName, class_tbl.class as SimClass,
type_tbl.type as ClassType, sim_tbl.npc as SimNPC FROM sim_tbl, class_tbl,
type_tbl WHERE sim_tbl.class = class_tbl.id AND class_tbl.type = type_tbl.id
AND sim_tbl.fleet = $fleet_id ORDER BY 1";
// -
--

$result =   mysql_query($query);
$num_rows   =   mysql_num_rows($result);

if ($num_rows != 0)
{
print "


   
   Class
   Name
   Type
   NPC
";

while ($row = mysql_fetch_array($result))
{

$name   =   $row["SimName"];
$class  =   $row["SimClass"];
$type   =   $row["ClassType"];
$NPC=   $row["SimNPC"];

if ($NPC == 1)
{
echo "


$class
$name
$type
NON PLAYING SIM\n";
}
else
{
echo "


class
    $name
$type
ACTIVE SIM\n";
}
};
}

"Matt Stewart" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> if you post a bit of the offending code then i'll have a look - sounds
> strange though
>
> -Original Message-
> From: Kevin Schaaps [mailto:[EMAIL PROTECTED]]
> Sent: 16 November 2001 11:44
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] PHP results bold in HTML
>
>
> Hi everyone,
>
> I've noticed something strange, and I was wondering if you knew the
answer:
> When I put the results of a query on a HTML page, the data that comes from
> the database (mysql) appears bold, while there is nothing to suggests it
> needs to that that in the HTML coding.
>
> I would like to change this so that the information isn't bolded.
>
> Any ideas or suggestions on this rather strange issue would be greatly
> appreciated!
>
> Yours,
>
> Kevin
>
>
>
> --
> PHP Database 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]
>
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
>



-- 
PHP Database 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]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
 

-- 
PHP Database 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-DB] help me on projecting some tables

2001-11-16 Thread matt stewart

not really sure how to do this, other than planning for as much as you can
in your original tables, then have a spare table with four columns - Row_ID,
Characteristic_Name, Characteristic_Value, and Product_Refer_ID.
so then if you get a new characteristic (eg colour) then you could have
values 1, colour, blue, 4(the product with this characteristic).
then the next line might be 2,colour,green,8
then 2,density,45kg/m3,8

etc.
not sure this is the best way, but the only way i can think of to have
various additional characteristics for some products.
hope it helps??
Matt

-Original Message-
From: Carlo Loiudice [mailto:[EMAIL PROTECTED]]
Sent: 16 November 2001 10:48
To: PHP DB
Subject: [PHP-DB] help me on projecting some tables


Hi,
I've to store in a BD some alimentary product, and
there are lot of informations like chemical, physical,
nutritional characteristics , ...
I don't know how to store this info.
So I've a lot of product with a lot of corresponding
characteristics.

I've thought about to create a table where to store
all chemical characteristics, a table for nutritional,
ecc. and put in the product table the refer ID to all
this caracteristic tables. 
But in this way, there's the problem that now I'm
storing 3 chemical charact. but tomorrow I'd like to
add a new charact., and I wouldn't change tha table
structure adding a new column every time I've a new
field that I haven't expected.

Can someone show me the right strategy to resolve this
kind of problem?

Ciao, Carlo

__

Abbonati a Yahoo! ADSL con Atlanet!
Naviga su Internet ad alta velocità, e senza limiti di tempo! 
Per saperne di più vai alla pagina http://adsl.yahoo.it

-- 
PHP Database 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]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
 

--
PHP Database 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-DB] PHP results bold in HTML

2001-11-16 Thread matt stewart

if you post a bit of the offending code then i'll have a look - sounds
strange though

-Original Message-
From: Kevin Schaaps [mailto:[EMAIL PROTECTED]]
Sent: 16 November 2001 11:44
To: [EMAIL PROTECTED]
Subject: [PHP-DB] PHP results bold in HTML


Hi everyone,

I've noticed something strange, and I was wondering if you knew the answer:
When I put the results of a query on a HTML page, the data that comes from
the database (mysql) appears bold, while there is nothing to suggests it
needs to that that in the HTML coding.

I would like to change this so that the information isn't bolded.

Any ideas or suggestions on this rather strange issue would be greatly
appreciated!

Yours,

Kevin



-- 
PHP Database 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]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
 

-- 
PHP Database 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-DB] Why use MySQL with PHP

2001-11-15 Thread matt stewart

sounds wonderful - do you know when (roughly) it's gonna be released? 
I thought that one of the reasons it was so fast was that the DB engine
wasn't cluttered with procedures? (which is why it's so damn good for
not-so-complicated sites)?
i'm no expert at all, but won't mySQL 4 therefore be slower?


-Original Message-
From: Lars B. Jensen [mailto:[EMAIL PROTECTED]]
Sent: 15 November 2001 12:19
To: matt stewart
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Why use MySQL with PHP


Stored procedures is missing in mySQL correct but is scheduled with the
exiting launch of the mySQL 4 family. mySQL has it's drawbacks, but main
force is it's performance, for certain tasks also with quite large datasets
(few million rows) I had mySQL outperform major players as Microsoft SQL
Server 7 and Oracle8i. I sadly never had my hands on PostgreSQL yet.

Again, it all comes down to make the optimal site for the job, not the
hardest technological. To revert a saying, why jump the fence where it is
the highest ? (thereby not saying we gotta jump where it is lowest, but
where it is appropriate to the task).

So, with experience and knowledge from major sites running daily thousands
of sessions and millions of pageviews I know mySQL is capable of the trick,
and with the mySQL 4 coming out, I for one is awaiting it with anticipation.
Especially the "stored procedures" which totally would eliminate my need for
Microsoft SQL Server.

/ Lars

> -Original Message-
> From: matt stewart [mailto:[EMAIL PROTECTED]]
> Sent: 15. november 2001 20:45
> To: 'søren eriksen'; [EMAIL PROTECTED]
> Subject: RE: [PHP-DB] Why use MySQL with PHP
>
>
> The main reasons are possibly later on its drawbacks - basically, its main
> attraction is the ease of use, as it's so simple!
> MySQL and PHP fit together so well and for people just learning scripting
> with databases, there's not much that's as easy to pick up quickly and
> produce basic database driven websites with.
> Obviously due to this, it's actually got no massive depth in
> terms of stored
> procedures (you can't), and won't be as effective or useful for running
> massive, complex sites that attract millions of visitors
> (something like SQL
> server would probably be better) but for most websites, it's free, it's
> easy, and it does the job!
>
> -Original Message-
> From: søren eriksen [mailto:[EMAIL PROTECTED]]
> Sent: 15 November 2001 20:34
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] Why use MySQL with PHP
>
>
> Hi everybody
> I'm writing a synopsis about PHP and mySQL.
> I'm hoping someone can help me, and tell me why
> the combination og PHP and MySQL is so common.
> What makes MySQL such a good choice when using PHP?
> What seperates MySQL from others dbms?
> -Søren Eriksen-
>
>
> --
> PHP Database 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]
>
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
>
>
> --
> PHP Database 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]
>


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
 

--
PHP Database 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-DB] Why use MySQL with PHP

2001-11-15 Thread matt stewart

The main reasons are possibly later on its drawbacks - basically, its main
attraction is the ease of use, as it's so simple!
MySQL and PHP fit together so well and for people just learning scripting
with databases, there's not much that's as easy to pick up quickly and
produce basic database driven websites with.
Obviously due to this, it's actually got no massive depth in terms of stored
procedures (you can't), and won't be as effective or useful for running
massive, complex sites that attract millions of visitors (something like SQL
server would probably be better) but for most websites, it's free, it's
easy, and it does the job!

-Original Message-
From: søren eriksen [mailto:[EMAIL PROTECTED]]
Sent: 15 November 2001 20:34
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Why use MySQL with PHP


Hi everybody
I'm writing a synopsis about PHP and mySQL.
I'm hoping someone can help me, and tell me why
the combination og PHP and MySQL is so common.
What makes MySQL such a good choice when using PHP?
What seperates MySQL from others dbms?
-Søren Eriksen-


-- 
PHP Database 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]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
 

--
PHP Database 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-DB] Problem with include()

2001-11-13 Thread matt stewart

That sounds the likely answer to me too - you don't generally try to send a
parameter to something you're including.
if you're just trying to go to that page after executing some code, do a
print "Location:yadayadayada...?id=KnChooseBoots"

-Original Message-
From: Bruno Gimenes Pereti [mailto:[EMAIL PROTECTED]]
Sent: 13 November 2001 13:41
To: PHP-DB
Subject: Re: [PHP-DB] Problem with include()


Does include accept parameter?
I have never tried.

I think php will try to find a file called "poll.php?id=KnChooseBoots" not a
file called poll and give argument for it. Also why do you need to put the
parameter if the variable id is already set?

Bruno.

- Original Message -
From: "TorrentUK" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, November 13, 2001 11:24 AM
Subject: Re: [PHP-DB] Problem with include()


> Hi Peter,
>
> I'll be surprised if that's it as I am running this through an Apache
server
> which insists on the \ being /
> Also all references to my images are / and they work fine.  In fact, I
think
> I mentioned, it calls the poll.php
> if I drop the argument part (?id=KnChooseBoots). It's all very strange.
>
> Thanks for the response. I might just give your suggestion just to be
sure.
> Rgds
> -torrent
>
> "Peter Lovatt" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Could it be windows doesn't like the '/' in the path. OK on a webpage,
but
> > not directly into the filesystem?
> >
> > Peter
> >
> > > -Original Message-
> > > From: TorrentUK [mailto:[EMAIL PROTECTED]]
> > > Sent: 13 November 2001 12:47
> > > To: [EMAIL PROTECTED]
> > > Subject: [PHP-DB] Problem with include()
> > >
> > >
> > > Can anyone spot why I get the error
> > >
> > > Warning: Failed opening
> > > 'd:/www/htdocs/ski-info-online/poll.php?id=KnChooseBoots' for
inclusion
> > > (include_path='') in
> > > d:\WWW\htdocs/ski-info-online/skiKnSkiBoots.php on line
> > > 113
> > >
> > > Here is the calling line:
> > >
> > >  > > "/ski-info-online/poll.php?id=KnChooseBoots"); ?>
> > >
> > > If I call poll.php?id=KnChooseBoots from the browser it works (exactly
> the
> > > same path).
> > > If I drop the argument it works (i.e. php include($DOCUMENT_ROOT .
> > > "/ski-info-online/poll.php"); ).
> > > So what the blazes is happening?
> > >
> > > The manual reads:
> > >
> > > /* Works. */
> > > include ("http://someserver/file.php?varone=1&vartwo=2";);
> > >
> > > and...
> > >
> > > require($DOCUMENT_ROOT . "/header.html");
> > >
> > > which are the techniques I think I have used.
> > > Thanks for any help
> > > -torrent
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > --
> > > PHP Database 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 Database 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 Database 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]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
 

-- 
PHP Database 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-DB] COPY files = Warning permission denyed

2001-11-09 Thread matt stewart

think the most likely is there is not a temporary upload directory set in
PHP on your server?
I'd check the relevant PHP settings first, also check the final destination
folder has relevant write permissions.

-Original Message-
From: Ivo [mailto:[EMAIL PROTECTED]]
Sent: 09 November 2001 16:53
To: [EMAIL PROTECTED]
Subject: [PHP-DB] COPY files = Warning permission denyed


When I try to copy some files from my local PC to the server there  appears
a message "
Warning: Unable to create '/xxx.gif': Permission denied in /xxx.php3" on
line xx

Where should I search the problem. In the apache server, php or linux.



-- 
PHP Database 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]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
 

-- 
PHP Database 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: RE: [PHP-DB] inserting array into mySQL

2001-11-09 Thread matt stewart

is that you John Wayne?

-Original Message-
From: Rick Emery [mailto:[EMAIL PROTECTED]]
Sent: 09 November 2001 14:33
To: [EMAIL PROTECTED]
Subject: RE: RE: [PHP-DB] inserting array into mySQL


Well we're a little far afield from Manchester.

However, in a match between the Dallas Cowboys (American Football team) and
Manchester United (Funny Football team), the win goes to the Cowboys.
yee...haaa...

-Original Message-
From: Russ Michell [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 09, 2001 8:27 AM
To: matt stewart
Cc: [EMAIL PROTECTED]
Subject: Re: RE: [PHP-DB] inserting array into mySQL


> >>As we say here in Dallas: there are two kinds of people...those who live
> in Texas...and those who wish they did.
Texas?? Never heard of it! Is that somewhere north of Manchester? ;-)

Russ

On Fri, 9 Nov 2001 14:22:22 -0000  matt stewart <[EMAIL PROTECTED]> wrote:

> >>As we say here in Dallas: there are two kinds of people...those who live
> in Texas...and those who wish they did.
> 
> 
> Full Metal Jacket? ;)
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
>  
> 
> -- 
> PHP Database 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]
> 

#---#

  "Believe nothing - consider everything"   
  
  Russ Michell
  Anglia Polytechnic University Webteam
  Room 1C 'The Eastings' East Road, Cambridge
  
  e: [EMAIL PROTECTED]
  w: www.apu.ac.uk/webteam

  www.theruss.com

#---#


-- 
PHP Database 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 Database 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]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
 

-- 
PHP Database 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-DB] inserting array into mySQL

2001-11-09 Thread matt stewart

yeah, something like that "only two kinds of people come from texas" as i
recall...
ah, friday afternoon humour.

-Original Message-
From: Rick Emery [mailto:[EMAIL PROTECTED]]
Sent: 09 November 2001 14:31
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] inserting array into mySQL


Was that line in the movie?  If so, wisely said.

-Original Message-----
From: matt stewart [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 09, 2001 8:22 AM
To: 'Rick Emery'; [EMAIL PROTECTED]
Subject: RE: [PHP-DB] inserting array into mySQL


>>As we say here in Dallas: there are two kinds of people...those who live
in Texas...and those who wish they did.


Full Metal Jacket? ;)

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
 


-- 
PHP Database 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]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
 

-- 
PHP Database 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-DB] inserting array into mySQL

2001-11-09 Thread matt stewart

>>As we say here in Dallas: there are two kinds of people...those who live
in Texas...and those who wish they did.


Full Metal Jacket? ;)

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
 

-- 
PHP Database 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-DB] Not a valid MySQL result resource

2001-11-09 Thread matt stewart

don't you need it to be SELECT login, password...
lowercase first letter? - if you're comparing the columns user.login and
user.password.

-Original Message-
From: DL Neil [mailto:[EMAIL PROTECTED]]
Sent: 09 November 2001 01:34
To: MPropre
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Not a valid MySQL result resource


>  //.../... first part of the code is to connect to the right DB on a MySQL
> server. It works fine
> //This code to show the query. It runs well under MySQL and gives 1 result
:
>  $query="SELECT Login, Password FROM `user` WHERE user.login=''$login''
and
> user.password=''$password''";
> //This var should contain a query result ressource:
>  $result_query=mysql_query($query);
> //Here's my error message after executing:
> // Supplied argument is not a valid MySQL result resource in this line:
>  $result_table=mysql_fetch_array($result_query);
> // I thought that this var ($result_table) should contain the row of 2
cells
> //And I expected to read $result_table['login'] or $result_table[0] as the
> first cell of the row...
> // I any of you can help me, poor php newby... :o) Great thanks !!
> ?>


=Please check the archives for advice about checking the result of every
mysql_...() call. It's much better to
know/be told by PHP/MySQL than to say "I thought that...I expected to ..."
=the $query assignment statement contains multiple double-quotes. These
cannot be 'nested'. Use a mixture of
single and double-quotes or 'escape' the inner set(s).
=also (and this may be a function of our email packages not a PHP thing) are
those single quotes around user?

=dn



-- 
PHP Database 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]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.295 / Virus Database: 159 - Release Date: 01/11/01
 

-- 
PHP Database 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-DB] getting results from INSERT

2001-10-26 Thread Matt Stewart

What i'm after is getting the primary key for a record that's just been
added - I have an image file upload accompanying a database addition, and
the image gets renamed $unique_ID.jpeg
only problem is that the current method inserts the information, which auto
produces the primary key, but the only way i know to extract that is by
doing a SELECT, searching for all the matching values to the ones just
entered, and if two entries are the same(except for the primary key - which
is unknown), the image will replace the earlier entry, rather than the one i
actually want it to be for. Is there a way of returning this primary key
immediately after that record is created?



-- 
PHP Database 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]