[PHP-DB] database search

2001-03-26 Thread Mark Collins

Hope you can help, I have put a basic database together which add, deletes,
updates and edits records but I am not sure where to start with searching
the data base. I have already got it working a bit using ereg and a while
loop, but it is case sensitive and wont find a match in the middle of a
string (or at least I dont think it will). Does anyone know of a better way
to do this?

Thanks



-- 
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] Saving a form

2001-03-26 Thread Pankaj Ahuja

I have a form that runs into several pages (17 pages in all). When a user
fills in the form, is there any way by which I can ask him to save the page
so that he can and return to the last filled page and resume at a later
stage ??


-- 
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] Re: Saving a form

2001-03-26 Thread Pankaj Ahuja

an example of this can be seen at http://www.cfsloans.com


- Original Message - 
From: Pankaj Ahuja 
To: [EMAIL PROTECTED] 
Sent: Monday, March 26, 2001 1:49 PM
Subject: Saving a form


I have a form that runs into several pages (17 pages in all). When a user
fills in the form, is there any way by which I can ask him to save the page
so that he can and return to the last filled page and resume at a later
stage ??


-- 
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] Tree structures...

2001-03-26 Thread richarda
 BDY.RTF

-- 
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] date_format yet again

2001-03-26 Thread boclair

I realise that CC Zona answered this question earlier but I haven't
understood.

I have attempted to use the date_format in generating the query
variable and applying the result with a while loop to display the date
data in an html table as dd-mmm-

Generating the query variable

include ("inputs/connect.php");

$plantavail = mysql_query("SELECT regno, type, size, drive, mfr,
date_format(online,'%d-%b-%Y'), date_format(offline,'%d-%b-%Y')  FROM
boclair.members where status='heavy' order by type, size");

And later the while loop

while ($myrow = mysql_fetch_array($plantavail)) {
printf('tr
td class=regno align=right%s/td
td class=type align=center%s/td
tdspan class=size%sspan/td
tdspan class=drive%sspan/td
tdspan class=mfr%sspan/td
tdspan class=date%sspan/td
tdspan class=date%sspan/td
/tr
', $myrow['regno'], $myrow['type'], $myrow['size'],
 $myrow['drive'], $myrow['mfr'], $myrow['online'], $myrow['offline']);
}

The date_format function used this way generates no errors or warning
but the variables, $myrow['online'], $myrow['offline']), are empty and
the dates are not displayed in the html table.

Obviously I am missing the boat.  The manual and references are
apparently beyond me.

Can I have some further help?

Tim Morris



-- 
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] Read lines

2001-03-26 Thread [EMAIL PROTECTED]

Hello,

I want to read lines from a file between !--begin-- And !--End--

Can someon help me.

Walter



Re: [PHP-DB] Read lines

2001-03-26 Thread Felix Kronlage

On Mon, Mar 26, 2001 at 12:38:38PM +0200, [EMAIL PROTECTED] wrote:

don't know why this is on php-db

 I want to read lines from a file between !--begin-- And !--End--

read the file line by line, match every line with a regexp. 
If you hit the line !--begin-- start stuffing the lines in array.
Once you hit the line !--End-- stop reading the file, close it and
your have every line in between in an array. should do the job just
fine.

-fkr
-- 
gpg-fingerprint: 076E 1E87 3E05 1C7F B1A0  8A48 0D31 9BD3 D9AC 74D0 
  |http://www.hazardous.org/ | whois -h whois.ripe.de FKR-RIPE  |
  |all your base are belong to us  |  shame on me  | fkr@IRCnet | 

 PGP signature


Re: [PHP-DB] Read lines

2001-03-26 Thread [EMAIL PROTECTED]

First Thx for your response

I don't think you know wat i mean.

My brother give me a HTML file. I must place a menu from a DB but
Then i must have the folowing code

!--begin_menu--
  tr
tdmenu/td
  /tr
!--end_menu--

So i must read from !--begin_menu-- till !--end_menu--.



- Original Message - 
From: Ben Cairns [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, March 26, 2001 12:34 PM
Subject: RE: [PHP-DB] Read lines


 HTH...
 
 ?
 $file = "YOUR URL/FILE HERE";
 $open = fopen($file, "r");
 $search = fread($open, FILE SIZE IN BYTES);
 fclose($open);
 $news[1] = str_replace("replace this, "with this", $grabbed[1]);
 ?
 
 ?
 echo $grabbed[1]
 ?
 
 -- Ben Cairns - Head Of Technical Operations
 intasept.COM
 Tel: 01332 365333
 Fax: 01332 346010
 E-Mail: [EMAIL PROTECTED]
 Web: http://www.intasept.com
 
 "MAKING sense of
 the INFORMATION
 TECHNOLOGY age
 @ WORK.."
 
 


-- 
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] date_format yet again

2001-03-26 Thread Boclair


"boclair" [EMAIL PROTECTED] wrote in message
000e01c0b5d0$720921c0$[EMAIL PROTECTED]">news:000e01c0b5d0$720921c0$[EMAIL PROTECTED]...
| I realise that CC Zona answered this question earlier but I haven't
| understood.
|
| I have attempted to use the date_format in generating the query
| variable and applying the result with a while loop to display the
date
| data in an html table as dd-mmm-
|
| Generating the query variable
|
| include ("inputs/connect.php");
|
| $plantavail = mysql_query("SELECT regno, type, size, drive, mfr,
| date_format(online,'%d-%b-%Y'), date_format(offline,'%d-%b-%Y')
FROM
| boclair.members where status='heavy' order by type, size");
|
| And later the while loop
|
| while ($myrow = mysql_fetch_array($plantavail)) {
| printf('tr
| td class=regno align=right%s/td
| td class=type align=center%s/td
| tdspan class=size%sspan/td
| tdspan class=drive%sspan/td
| tdspan class=mfr%sspan/td
| tdspan class=date%sspan/td
| tdspan class=date%sspan/td
| /tr
| ', $myrow['regno'], $myrow['type'], $myrow['size'],
|  $myrow['drive'], $myrow['mfr'], $myrow['online'],
$myrow['offline']);
| }

Thanks but I found the answer at PHPBuilder Support forum.  CCZona had
already given it to me but I need spoon feeding.

For the few that might also have a problem with reformatting the mysql
date for display in an html document, here is the answer and it works.

| $plantavail = mysql_query("SELECT regno, type, size, drive, mfr,
| date_format(online,'%d-%b-%Y'), date_format(offline,'%d-%b-%Y')
FROM
| boclair.members where status='heavy' order by type, size");

should read

| $plantavail = mysql_query("SELECT regno, type, size, drive, mfr,
| date_format(online,'%d-%b-%Y') AS logon,
date_format(offline,'%d-%b-%Y')  AS logoff FROM
| boclair.members where status='heavy' order by type, size");

and

|  $myrow['drive'], $myrow['mfr'], $myrow['online'],
$myrow['offline']);

should read

|  $myrow['drive'], $myrow['mfr'], $myrow['logon'], $myrow['logoff']);

Reference http://www.phpbuilder.com/forum/archives/2/2001/2/1/122514

Tim Morris




-- 
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] Another newbie question

2001-03-26 Thread Matt Coyne

Hi guys/gals

Having had my head sorted out by this list already today, I am in need of
some more help...!!

I have an input form that, through php queries a MySQL db and passes results
back and the browser displays them (at this stage just as a list).

I have been looking into the LIMIT command to split my results into sections
(ie results 1-10 then 11-20 etc). No problem in understanding how LIMIT
works and I have LIMITed the first set to the first 10 results. I understand
that to show results 11-20 I would use LIMIT 10, 10 in my SQL query.

However, how am I to update the LIMIT n, 10 dynamically depending on what
split of results they are viewing. ie How do I recall the SQL query but with
an update LIMIT value

Here is what I have been doing:

// ASSEMBLE SQL QUERY
// make the select
$select = "SELECT ref, firstname, surname ";

//add the tablename to the query
$fromtable = "FROM $table_name";
//$fromtable .= "$tablename";

//build where clause
$control=1;
$where = " WHERE $control=1 ";

//determine if field sent value, build statement if true
if ($sex != '') {
$Qsex = "AND sex = '$sex' ";
} else {
$Qsex = "";
}

if ($heightFt != '') {
$QheightFt = "AND heightFt = '$heightFt' ";
} else {
$QheightFt = "";
}

if ($heightIn != '') {
$QheightIn = "AND heightIn LIKE '$heightIn%' ";
} else {
$QheightIn = "";
}

if ($neck != '') {
$Qneck = "AND neck LIKE '$neck%' ";
} else {
$Qneck = "";
}

if ($chest != '') {
$Qchest = "AND chest LIKE '$chest%' ";
} else {
$Qchest = "";
}

if ($waist != '') {
$Qwaist = "AND waist LIKE '$waist%' ";
} else {
$Qwaist = "";
}

if ($hips != '') {
$Qhips = "AND hips LIKE '$hips%' ";
} else {
$Qhips = "";
}

if ($leg != '') {
$Qleg = "AND leg LIKE '$leg%' ";
} else {
$Qleg = "";
}

if ($shoe != '') {
$Qshoe = "AND shoe LIKE '$shoe%' ";
} else {
$Qshoe = "";
}

if ($dress != '') {
$Qdress = "AND dress LIKE '$dress%' ";
} else {
$Qdress = "";
}

if ($hair != '') {
$Qhair = "AND hair LIKE '$hair%' ";
} else {
$Qhair = "";
}

if ($eyes != '') {
$Qeyes = "AND eye LIKE '$eyes%' ";
} else {
$Qeyes = "";
}

if ($skin != '') {
$Qskin = "AND skin LIKE '$skin%' ";
} else {
$Qskin = "";
}

if ($nationality != '') {
$Qnationality = "AND nationality LIKE '$nationality%' ";
} else {
$Qnationality = "";
}

// specify how results are ordered
$orderby = "ORDER BY surname ";

// offset is a hidden value in the initial form == 0
if ($offset = '0') {
$offset = 0;
}


// specify LIMIT
$limit = "LIMIT ";
$limit .= $offset;
$limit .= ", 10";

//build concatenated query
$concatsql = $select;
$concatsql .= $fromtable;
$concatsql .= $where;
$concatsql .= $Qsex;
$concatsql .= $QheightFt;
$concatsql .= $QheightIn;
$concatsql .= $Qneck;
$concatsql .= $Qchest;
$concatsql .= $Qwaist;
$concatsql .= $Qhips;
$concatsql .= $Qleg;
$concatsql .= $Qshoe;
$concatsql .= $Qdress;
$concatsql .= $Qhair;
$concatsql .= $Qeyes;
$concatsql .= $Qskin;
$concatsql .= $Qnationality;
$concatsql .= $orderby;
$concatsql .= $limit;


// make query
$result=@mysql_query($concatsql, $connection) or die (mysql_error() .
"BRBfrom query:/B$concatsql");

//detect amount of rows in result for display
$num_rows = mysql_num_rows($result);

//start building set of results to be echoed in browser
$contact_list= "UL";

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

$ref = $row['ref'];
$firstname = $row['firstname'];
$surname = $row['surname'];

$contact_list .="LIA HREF=\"show_record.php?ref=$ref\"$surname,
$firstname/A";

}

$contact_list .="/UL";

// add 10 to offset for next set of results
$offset +=10;

So, that all works for the first set of results but I do not know where to
go from here. I am assuming the last sectionis the way to go to increase the
offset value but I don't know what to do with it next!! I have been scouring
phpbuilder and devshed with no luck so far.

Any help very much appreciated

cheers
matt 

t  h  r  e  e  z  e  r  o :   :  :

the mill, millstone lane, leicester, le1 5jn
e : [EMAIL PROTECTED] ::  m : 07747 845690
w : http://www.threezero.co.uk

:   :  :t  h  r  e  e  z  e  r  o



-- 
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] regular expressions

2001-03-26 Thread Mircea Romanitan

Hello all.

Can anyone tell me where i can find some detalied help about regular expressions used 
at ereg, eregi, etc ?

Thanks
Mircea



RE: [PHP-DB] Another newbie question

2001-03-26 Thread Michael Rudel

OK, Matt, so you've got the basics =8).

Your beginning is good, using the $Offset. Now you only have to
add navigation-buttons (First, Previos, Next, Last) with html
and a hidden field namded Offset.
LIMIT is defined as a constant. You could also use your $Limit.

here is a snippet of my navigation code:


  //
  // Event-Handler

  if ( isset( $Offset ) )
  {
 // First-Button
 if ( isset( $First ) and !empty( $First ) )
 {
$Offset = 0;
 }

 // Next-Button
 if ( isset( $Next ) and !empty( $Next ) )
 {
if ( $Offset = ( $num_rows - LIMIT ) )
{
   $Offset += LIMIT;
}
 }

 // Previous-Button
 if ( isset( $Prev ) and !empty( $Prev ) )
 {
if ( $Offset = LIMIT )
{
   $Offset -= LIMIT;
}
else
{
   $Offset = 0;
}
 }

 // Last-Button
 if ( isset( $Last ) and !empty( $Last ) )
 {
$Offset = ($num_rows - LIMIT);
 }
  }
  else
  {
 $Offset = 0;
  }

// End Event-Handler
//


Hope this helps. If there are still questions ... ask =8)

Greetinx,
  Mike

Michael Rudel
- Web-Development, Systemadministration -
___

Suchtreffer AG
Bleicherstrae 20
D-78467 Konstanz
Germany
fon: +49-(0)7531-89207-17
fax: +49-(0)7531-89207-13
e-mail: mailto:[EMAIL PROTECTED]
internet: http://www.suchtreffer.de
___



 -Original Message-
 From: Matt Coyne [mailto:[EMAIL PROTECTED]]
 Sent: Monday, March 26, 2001 1:39 PM
 To: PHP DB
 Subject: [PHP-DB] Another newbie question


 Hi guys/gals

 Having had my head sorted out by this list already today, I
 am in need of
 some more help...!!

 I have an input form that, through php queries a MySQL db and
 passes results
 back and the browser displays them (at this stage just as a list).

 I have been looking into the LIMIT command to split my
 results into sections
 (ie results 1-10 then 11-20 etc). No problem in understanding
 how LIMIT
 works and I have LIMITed the first set to the first 10
 results. I understand
 that to show results 11-20 I would use LIMIT 10, 10 in my SQL query.

 However, how am I to update the LIMIT n, 10 dynamically
 depending on what
 split of results they are viewing. ie How do I recall the SQL
 query but with
 an update LIMIT value

 Here is what I have been doing:

 // ASSEMBLE SQL QUERY
 // make the select
 $select = "SELECT ref, firstname, surname ";

 //add the tablename to the query
 $fromtable = "FROM $table_name";
 //$fromtable .= "$tablename";

 //build where clause
 $control=1;
 $where = " WHERE $control=1 ";

 //determine if field sent value, build statement if true
 if ($sex != '') {
 $Qsex = "AND sex = '$sex' ";
 } else {
 $Qsex = "";
 }

 if ($heightFt != '') {
 $QheightFt = "AND heightFt = '$heightFt' ";
 } else {
 $QheightFt = "";
 }

 if ($heightIn != '') {
 $QheightIn = "AND heightIn LIKE '$heightIn%' ";
 } else {
 $QheightIn = "";
 }

 if ($neck != '') {
 $Qneck = "AND neck LIKE '$neck%' ";
 } else {
 $Qneck = "";
 }

 if ($chest != '') {
 $Qchest = "AND chest LIKE '$chest%' ";
 } else {
 $Qchest = "";
 }

 if ($waist != '') {
 $Qwaist = "AND waist LIKE '$waist%' ";
 } else {
 $Qwaist = "";
 }

 if ($hips != '') {
 $Qhips = "AND hips LIKE '$hips%' ";
 } else {
 $Qhips = "";
 }

 if ($leg != '') {
 $Qleg = "AND leg LIKE '$leg%' ";
 } else {
 $Qleg = "";
 }

 if ($shoe != '') {
 $Qshoe = "AND shoe LIKE '$shoe%' ";
 } else {
 $Qshoe = "";
 }

 if ($dress != '') {
 $Qdress = "AND dress LIKE '$dress%' ";
 } else {
 $Qdress = "";
 }

 if ($hair != '') {
 $Qhair = "AND hair LIKE '$hair%' ";
 } else {
 $Qhair = "";
 }

 if ($eyes != '') {
 $Qeyes = "AND eye LIKE '$eyes%' ";
 } else {
 $Qeyes = "";
 }

 if ($skin != '') {
 $Qskin = "AND skin LIKE '$skin%' ";
 } else {
 $Qskin = "";
 }

 if ($nationality != '') {
 $Qnationality = "AND nationality LIKE '$nationality%' ";
 } else {
 $Qnationality = "";
 }

 // specify how results are ordered
 $orderby = "ORDER BY surname ";

 // offset is a hidden value in the initial form == 0
 if ($offset = '0') {
 $offset = 0;
 }


 // specify LIMIT
 $limit = "LIMIT ";
 $limit .= $offset;
 $limit .= ", 10";

 //build concatenated query
 $concatsql = $select;
 $concatsql .= $fromtable;
 $concatsql .= $where;
 $concatsql .= $Qsex;
 $concatsql .= $QheightFt;
 $concatsql .= $QheightIn;
 $concatsql .= $Qneck;
 $concatsql .= $Qchest;
 $concatsql .= $Qwaist;
 $concatsql .= $Qhips;
 $concatsql .= $Qleg;
 $concatsql .= $Qshoe;
 $concatsql .= $Qdress;
 $concatsql .= $Qhair;
 $concatsql .= $Qeyes;
 $concatsql .= $Qskin;
 $concatsql .= $Qnationality;
 $concatsql .= $orderby;
 $concatsql .= $limit;


 // make query
 

[PHP-DB] classes and sessions

2001-03-26 Thread Steve Brett

hi,
 
i'm busily rewriting an exisitng calendar system that is in use at work.
 
we're using UML as a design tool and hope to have an OO version of the
system we have at the minute that wil 'fit in' with future devs.
 
our system at the moment makes heavy use of postgresql and i am hoping to
populate various object from the data in the db.
 
our system also relies on session for passing data between pages and the
site as a whole.
 
what i need to know is this in a kind of yes or no fashion:
 
will php allow me to create a class and then have access to the class from
other pages and scripts ?
 
 
Steve Brett 
Internal Development 
EMIS Ltd. 

"Privileged and /or Confidential information may be contained in this
message. If you are not the original addressee indicated in this message (or
responsible for delivery of the message to such person), you may not copy or
deliver this message to anyone. In such case, please delete this message,
and notify us immediately. Opinions, conclusions and other information
expressed in this message are not given or endorsed by my firm or employer
unless otherwise indicated by an authorised representative independently of
this message."

Egton Medical Information Systems Limited. Registered in England. No
2117205. 
Registered Office: Park House Mews, 77 Back Lane, Off Broadway, Horsforth,
Leeds, LS18 4RF

 

-- 
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] Another newbie question

2001-03-26 Thread Matt Coyne

Hi Michael

Thanks for the prompt reply, much appreciated

I can see where the code snippet is going. Creating values for $offset for
the set of navigation buttons.

But how do I use those values?

I am stumped on (and am prolly just blinkered) how to make the query again
from the nav button?

If I am barking madly up the wrong tree, then I apologise. I'm not sure if I
have covered the basics, more like I have learnt what I thought I needed as
I went along. There are bound to be large gaping wholes in my knowledge, so
further help is definitely required.

TIA
matt

t  h  r  e  e  z  e  r  o :   :  :

the mill, millstone lane, leicester, le1 5jn
e : [EMAIL PROTECTED] ::  m : 07747 845690
w : http://www.threezero.co.uk

:   :  :t  h  r  e  e  z  e  r  o


 From: "Michael Rudel" [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 Date: Mon, 26 Mar 2001 14:48:20 +0200
 To: "'Matt Coyne'" [EMAIL PROTECTED], "'PHP DB'" [EMAIL PROTECTED]
 Subject: RE: [PHP-DB] Another newbie question
 
 OK, Matt, so you've got the basics =8).
 
 Your beginning is good, using the $Offset. Now you only have to
 add navigation-buttons (First, Previos, Next, Last) with html
 and a hidden field namded Offset.
 LIMIT is defined as a constant. You could also use your $Limit.
 
 here is a snippet of my navigation code:
 
 
 //
 // Event-Handler
 
 if ( isset( $Offset ) )
 {
// First-Button
if ( isset( $First ) and !empty( $First ) )
{
   $Offset = 0;
}
 
// Next-Button
if ( isset( $Next ) and !empty( $Next ) )
{
   if ( $Offset = ( $num_rows - LIMIT ) )
   {
  $Offset += LIMIT;
   }
}
 
// Previous-Button
if ( isset( $Prev ) and !empty( $Prev ) )
{
   if ( $Offset = LIMIT )
   {
  $Offset -= LIMIT;
   }
   else
   {
  $Offset = 0;
   }
}
 
// Last-Button
if ( isset( $Last ) and !empty( $Last ) )
{
   $Offset = ($num_rows - LIMIT);
}
 }
 else
 {
$Offset = 0;
 }
 
 // End Event-Handler
 //
 
 
 Hope this helps. If there are still questions ... ask =8)
 
 Greetinx,
 Mike
 
 Michael Rudel
 - Web-Development, Systemadministration -
 ___
 
 Suchtreffer AG
 Bleicherstrae 20
 D-78467 Konstanz
 Germany
 fon: +49-(0)7531-89207-17
 fax: +49-(0)7531-89207-13
 e-mail: mailto:[EMAIL PROTECTED]
 internet: http://www.suchtreffer.de
 ___
 
 
 
 -Original Message-
 From: Matt Coyne [mailto:[EMAIL PROTECTED]]
 Sent: Monday, March 26, 2001 1:39 PM
 To: PHP DB
 Subject: [PHP-DB] Another newbie question
 
 
 Hi guys/gals
 
 Having had my head sorted out by this list already today, I
 am in need of
 some more help...!!
 
 I have an input form that, through php queries a MySQL db and
 passes results
 back and the browser displays them (at this stage just as a list).
 
 I have been looking into the LIMIT command to split my
 results into sections
 (ie results 1-10 then 11-20 etc). No problem in understanding
 how LIMIT
 works and I have LIMITed the first set to the first 10
 results. I understand
 that to show results 11-20 I would use LIMIT 10, 10 in my SQL query.
 
 However, how am I to update the LIMIT n, 10 dynamically
 depending on what
 split of results they are viewing. ie How do I recall the SQL
 query but with
 an update LIMIT value
 
 Here is what I have been doing:
 
 // ASSEMBLE SQL QUERY
 // make the select
 $select = "SELECT ref, firstname, surname ";
 
 //add the tablename to the query
 $fromtable = "FROM $table_name";
 //$fromtable .= "$tablename";
 
 //build where clause
 $control=1;
 $where = " WHERE $control=1 ";
 
 //determine if field sent value, build statement if true
 if ($sex != '') {
 $Qsex = "AND sex = '$sex' ";
 } else {
 $Qsex = "";
 }
 
 if ($heightFt != '') {
 $QheightFt = "AND heightFt = '$heightFt' ";
 } else {
 $QheightFt = "";
 }
 
 if ($heightIn != '') {
 $QheightIn = "AND heightIn LIKE '$heightIn%' ";
 } else {
 $QheightIn = "";
 }
 
 if ($neck != '') {
 $Qneck = "AND neck LIKE '$neck%' ";
 } else {
 $Qneck = "";
 }
 
 if ($chest != '') {
 $Qchest = "AND chest LIKE '$chest%' ";
 } else {
 $Qchest = "";
 }
 
 if ($waist != '') {
 $Qwaist = "AND waist LIKE '$waist%' ";
 } else {
 $Qwaist = "";
 }
 
 if ($hips != '') {
 $Qhips = "AND hips LIKE '$hips%' ";
 } else {
 $Qhips = "";
 }
 
 if ($leg != '') {
 $Qleg = "AND leg LIKE '$leg%' ";
 } else {
 $Qleg = "";
 }
 
 if ($shoe != '') {
 $Qshoe = "AND shoe LIKE '$shoe%' ";
 } else {
 $Qshoe = "";
 }
 
 if ($dress != '') {
 $Qdress = "AND dress LIKE '$dress%' ";
 } else {
 $Qdress = "";
 }
 
 if ($hair != '') {
 $Qhair = "AND hair LIKE '$hair%' ";
 } else {
 $Qhair = "";
 }
 
 if ($eyes != '') {
 $Qeyes = "AND eye 

Re: [PHP-DB] date_format yet again

2001-03-26 Thread Boclair

It has been pointed out to me that there is an error.  I had failed to
include the two date fields in the select.  The actual scripting is.

The query

include ("inputs/connect.php");

|$plantavail = mysql_query("SELECT * date_format(online,'%d-%b-%Y') AS
logon,
date_format(offline,'%d-%b-%Y') )  AS logoff
FROM
boclair.members where status='heavy' order by type, size");

the while loop

while ($myrow = mysql_fetch_array($plantavail)) {
printf('tr
td class=regno align=right%s/td
td class=type align=center%s/td
tdspan class=size%sspan/td
tdspan class=drive%sspan/td
tdspan class=mfr%sspan/td
tdspan class=date%sspan/td
tdspan class=date%sspan/td
/tr
', $myrow['regno'], $myrow['type'], $myrow['size'],
$myrow['drive'], $myrow['mfr'], $myrow['logon'],
$myrow['logoff']);

Sorry

Tim Morris





-- 
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] Another newbie question

2001-03-26 Thread Michael Rudel

Ok, so you have to put the 'Offset-Event-Handler' prior to your
select-statement. $Offset is calculatet by the event-handler and
then you specify the LIMIT (already done in your skript):

// specify LIMIT
$limit = "LIMIT ";
$limit .= $Offset;
$limit .= ", 10";

... here comes your query ...

after displaying the results, build something like this (in HTML):

FORM Name="Navigation" Action="?php echo $PHP_SELF; ?" Method="POST"
INPUT Type="Submit" Name="First" Value="First"
INPUT Type="Submit" Name="Prev" Value="Prev."
INPUT Type="Submit" Name="Next" Value="Next"
INPUT Type="Submit" Name="Last" Value="Last"

INPUT Type="Hidden" Name="Offset" Value="?php echo $Offset; ?"
/FORM

... so you have your $Offset (initially zero) stored in the hidden field.
If you hit a Button, then the skript loads itself new and it has now the
var's $Offset which will be new calculatet regarding of the Button you hit.

Simple, ain't ?! 8)=)

I hope, you're getting closer.

BTW, there are ready Navigateable Recordset-Classes for results in
http://phpclasses.upperdesign.com/

Greetinx,
  Mike

 -Original Message-
 From: Matt Coyne [mailto:[EMAIL PROTECTED]]
 Sent: Monday, March 26, 2001 3:22 PM
 To: PHP DB
 Subject: Re: [PHP-DB] Another newbie question


 Hi Michael

 Thanks for the prompt reply, much appreciated

 I can see where the code snippet is going. Creating values
 for $offset for
 the set of navigation buttons.

 But how do I use those values?

 I am stumped on (and am prolly just blinkered) how to make
 the query again
 from the nav button?

 If I am barking madly up the wrong tree, then I apologise.
 I'm not sure if I
 have covered the basics, more like I have learnt what I
 thought I needed as
 I went along. There are bound to be large gaping wholes in my
 knowledge, so
 further help is definitely required.

 TIA
 matt

 t  h  r  e  e  z  e  r  o :   :  :

 the mill, millstone lane, leicester, le1 5jn
 e : [EMAIL PROTECTED] ::  m : 07747 845690
 w : http://www.threezero.co.uk

 :   :  :t  h  r  e  e  z  e  r  o


  From: "Michael Rudel" [EMAIL PROTECTED]
  Reply-To: [EMAIL PROTECTED]
  Date: Mon, 26 Mar 2001 14:48:20 +0200
  To: "'Matt Coyne'" [EMAIL PROTECTED], "'PHP DB'"
 [EMAIL PROTECTED]
  Subject: RE: [PHP-DB] Another newbie question
 
  OK, Matt, so you've got the basics =8).
 
  Your beginning is good, using the $Offset. Now you only have to
  add navigation-buttons (First, Previos, Next, Last) with html
  and a hidden field namded Offset.
  LIMIT is defined as a constant. You could also use your $Limit.
 
  here is a snippet of my navigation code:
 
 
  //
  // Event-Handler
 
  if ( isset( $Offset ) )
  {
 // First-Button
 if ( isset( $First ) and !empty( $First ) )
 {
$Offset = 0;
 }
 
 // Next-Button
 if ( isset( $Next ) and !empty( $Next ) )
 {
if ( $Offset = ( $num_rows - LIMIT ) )
{
   $Offset += LIMIT;
}
 }
 
 // Previous-Button
 if ( isset( $Prev ) and !empty( $Prev ) )
 {
if ( $Offset = LIMIT )
{
   $Offset -= LIMIT;
}
else
{
   $Offset = 0;
}
 }
 
 // Last-Button
 if ( isset( $Last ) and !empty( $Last ) )
 {
$Offset = ($num_rows - LIMIT);
 }
  }
  else
  {
 $Offset = 0;
  }
 
  // End Event-Handler
  //
 
 
  Hope this helps. If there are still questions ... ask =8)
 
  Greetinx,
  Mike
 
  Michael Rudel
  - Web-Development, Systemadministration -
  ___
 
  Suchtreffer AG
  Bleicherstrae 20
  D-78467 Konstanz
  Germany
  fon: +49-(0)7531-89207-17
  fax: +49-(0)7531-89207-13
  e-mail: mailto:[EMAIL PROTECTED]
  internet: http://www.suchtreffer.de
  ___
 
 
 
  -Original Message-
  From: Matt Coyne [mailto:[EMAIL PROTECTED]]
  Sent: Monday, March 26, 2001 1:39 PM
  To: PHP DB
  Subject: [PHP-DB] Another newbie question
 
 
  Hi guys/gals
 
  Having had my head sorted out by this list already today, I
  am in need of
  some more help...!!
 
  I have an input form that, through php queries a MySQL db and
  passes results
  back and the browser displays them (at this stage just as a list).
 
  I have been looking into the LIMIT command to split my
  results into sections
  (ie results 1-10 then 11-20 etc). No problem in understanding
  how LIMIT
  works and I have LIMITed the first set to the first 10
  results. I understand
  that to show results 11-20 I would use LIMIT 10, 10 in my
 SQL query.
 
  However, how am I to update the LIMIT n, 10 dynamically
  depending on what
  split of results they are viewing. ie How do I recall the SQL

RE: [PHP-DB] Another newbie question

2001-03-26 Thread Brunner, Daniel

Hello

I too wanted to have next/previous links...

So I found this and it's the best out there...

http://www.oreillynet.com/pub/a/php/2000/11/02/next_previous.html?page=1

to output the query...

echo $data-Print_Name  //Or whatever you want to
display

.

Within that code you will be able to use Tables and suchThere is
more to the code...

So download the example and nav.php and you will be able to understand
how he did it.

mysql_fetch_object can be used for many thingslike for a EDIT/VIEW
entry links

printf ("TD WIDTH=80a href=\"%s?Art_Job_Number=%s\"%s %s/a\n",
"list.php", $data-Art_Job_Number, "BEdit/B", "BView/B");

Since I have a lot of Columns the page was to big to display so I choose
to only list 3 columns and then click the link to view all of the Data.
Just like PHPMYADMIN

I hope this helps.Oh navbar.php is a class...

Dan 



 --
 From: Matt Coyne
 Sent: Monday, March 26, 2001 5:39 AM
 To:   PHP DB
 Subject:  [PHP-DB] Another newbie question
 
 Hi guys/gals
 
 Having had my head sorted out by this list already today, I am in need
 of
 some more help...!!
 
 I have an input form that, through php queries a MySQL db and passes
 results
 back and the browser displays them (at this stage just as a list).
 
 I have been looking into the LIMIT command to split my results into
 sections
 (ie results 1-10 then 11-20 etc). No problem in understanding how
 LIMIT
 works and I have LIMITed the first set to the first 10 results. I
 understand
 that to show results 11-20 I would use LIMIT 10, 10 in my SQL query.
 
 However, how am I to update the LIMIT n, 10 dynamically depending on
 what
 split of results they are viewing. ie How do I recall the SQL query
 but with
 an update LIMIT value
 
 Here is what I have been doing:
 
 // ASSEMBLE SQL QUERY
 // make the select
 $select = "SELECT ref, firstname, surname ";
 
 //add the tablename to the query
 $fromtable = "FROM $table_name";
 //$fromtable .= "$tablename";
 
 //build where clause
 $control=1;
 $where = " WHERE $control=1 ";
 
 //determine if field sent value, build statement if true
 if ($sex != '') {
 $Qsex = "AND sex = '$sex' ";
 } else {
 $Qsex = "";
 }
 
 if ($heightFt != '') {
 $QheightFt = "AND heightFt = '$heightFt' ";
 } else {
 $QheightFt = "";
 }
 
 if ($heightIn != '') {
 $QheightIn = "AND heightIn LIKE '$heightIn%' ";
 } else {
 $QheightIn = "";
 }
 
 if ($neck != '') {
 $Qneck = "AND neck LIKE '$neck%' ";
 } else {
 $Qneck = "";
 }
 
 if ($chest != '') {
 $Qchest = "AND chest LIKE '$chest%' ";
 } else {
 $Qchest = "";
 }
 
 if ($waist != '') {
 $Qwaist = "AND waist LIKE '$waist%' ";
 } else {
 $Qwaist = "";
 }
 
 if ($hips != '') {
 $Qhips = "AND hips LIKE '$hips%' ";
 } else {
 $Qhips = "";
 }
 
 if ($leg != '') {
 $Qleg = "AND leg LIKE '$leg%' ";
 } else {
 $Qleg = "";
 }
 
 if ($shoe != '') {
 $Qshoe = "AND shoe LIKE '$shoe%' ";
 } else {
 $Qshoe = "";
 }
 
 if ($dress != '') {
 $Qdress = "AND dress LIKE '$dress%' ";
 } else {
 $Qdress = "";
 }
 
 if ($hair != '') {
 $Qhair = "AND hair LIKE '$hair%' ";
 } else {
 $Qhair = "";
 }
 
 if ($eyes != '') {
 $Qeyes = "AND eye LIKE '$eyes%' ";
 } else {
 $Qeyes = "";
 }
 
 if ($skin != '') {
 $Qskin = "AND skin LIKE '$skin%' ";
 } else {
 $Qskin = "";
 }
 
 if ($nationality != '') {
 $Qnationality = "AND nationality LIKE '$nationality%' ";
 } else {
 $Qnationality = "";
 }
 
 // specify how results are ordered
 $orderby = "ORDER BY surname ";
 
 // offset is a hidden value in the initial form == 0
 if ($offset = '0') {
 $offset = 0;
 }
 
 
 // specify LIMIT
 $limit = "LIMIT ";
 $limit .= $offset;
 $limit .= ", 10";
 
 //build concatenated query
 $concatsql = $select;
 $concatsql .= $fromtable;
 $concatsql .= $where;
 $concatsql .= $Qsex;
 $concatsql .= $QheightFt;
 $concatsql .= $QheightIn;
 $concatsql .= $Qneck;
 $concatsql .= $Qchest;
 $concatsql .= $Qwaist;
 $concatsql .= $Qhips;
 $concatsql .= $Qleg;
 $concatsql .= $Qshoe;
 $concatsql .= $Qdress;
 $concatsql .= $Qhair;
 $concatsql .= $Qeyes;
 $concatsql .= $Qskin;
 $concatsql .= $Qnationality;
 $concatsql .= $orderby;
 $concatsql .= $limit;
 
 
 // make query
 $result=@mysql_query($concatsql, $connection) or die (mysql_error() .
 "BRBfrom query:/B$concatsql");
 
 //detect amount of rows in result for display
 $num_rows = mysql_num_rows($result);
 
 //start building set of results to be echoed in browser
 $contact_list= "UL";
 
 while ($row = mysql_fetch_array($result)) {
 
 $ref = $row['ref'];
 $firstname = $row['firstname'];
 $surname = $row['surname'];
 
 $contact_list .="LIA HREF=\"show_record.php?ref=$ref\"$surname,
 $firstname/A";
 
 }
 
 $contact_list .="/UL";
 
 // add 10 to offset for next set of results
 $offset +=10;
 
 So, that all works for the first set of results but I do not know
 where to
 go from here. I am assuming the last sectionis the way to go to
 increase the
 offset value but I don't know what to do with it next!! I have been
 scouring
 

[PHP-DB] Regular expressions

2001-03-26 Thread Mircea Romanitan

Hello all.

Can anyone tell me where i can find some detalied help about regular expressions used 
at ereg, eregi, etc ?

For example i have this string:
html
head
meta name="keywords" content="poli, easjkdha, owersweoihjwe, uitsodgfisdgisdiv"
meta name="description" content="a, , wereee, 
r"
titleosdfjsoidiid  werioeiorigfs dfv sdfvo sdivvhdoososos /title
/head

body
siodfhyusiodfusdfjkdjfskodjfdjfsdkljfskldjfsd
sdfskdjfhksdjfhskldsldkjfsldkfjsldkfjsldkfjsdf

a href="a.php"some web page/a
/body
/html

then i have this:
eregi("META NAME=\"keywords\" CONTENT=\"(.)*\"", $strAux, $arrKeywords);

and the variable $arrKeywords[1] is : poli, easjkdha, owersweoihjwe, 
uitsodgfisdgisdiv"
meta name="description" content="a, , wereee, 
r"
titleosdfjsoidiid  werioeiorigfs dfv sdfvo sdivvhdoososos /title
/head

body
siodfhyusiodfusdfjkdjfskodjfdjfsdkljfskldjfsd
sdfskdjfhksdjfhskldsldkjfsldkfjsldkfjsldkfjsdf

a href="a.php

It gets all the string till the last " . But i need to go till the first " after 
meta 

Thanks
Mircea




RE: [PHP-DB] classes and sessions

2001-03-26 Thread Cal Evans

Yes.

You can create your class, instantiate it and store it in the session like
any other variable.  However. before you issue a Session_start() you MUST
have already included the class definition in your page.  If you start the
session and  have not, it will  throw an error because it will not know how
to use your class.

Am I making sense? (I don't think the coffee has kicked in yet.)

Cal
http://www.calevans.com


-Original Message-
From: Steve Brett [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 26, 2001 6:59 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] classes and sessions


hi,

i'm busily rewriting an exisitng calendar system that is in use at work.

we're using UML as a design tool and hope to have an OO version of the
system we have at the minute that wil 'fit in' with future devs.

our system at the moment makes heavy use of postgresql and i am hoping to
populate various object from the data in the db.

our system also relies on session for passing data between pages and the
site as a whole.

what i need to know is this in a kind of yes or no fashion:

will php allow me to create a class and then have access to the class from
other pages and scripts ?


Steve Brett
Internal Development
EMIS Ltd.

"Privileged and /or Confidential information may be contained in this
message. If you are not the original addressee indicated in this message (or
responsible for delivery of the message to such person), you may not copy or
deliver this message to anyone. In such case, please delete this message,
and notify us immediately. Opinions, conclusions and other information
expressed in this message are not given or endorsed by my firm or employer
unless otherwise indicated by an authorised representative independently of
this message."

Egton Medical Information Systems Limited. Registered in England. No
2117205.
Registered Office: Park House Mews, 77 Back Lane, Off Broadway, Horsforth,
Leeds, LS18 4RF



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




RE: [PHP-DB] reading a URL...

2001-03-26 Thread Cal Evans

Try:

$sqlStatement = "Select * from newStories where id =
".$GLOBALS['HTTP_GET_VARS']['id']. " order by whateverValue";

Then execute that statement.
The value ID that you passed in on the URL is stored in the associative
array $HTTP_GET_VARS.  Check the manual at www.php.net, there's a section on
variables and it has a list of re-defined variables.

HTH,
Cal
http://www.calevans.com


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Monday, March 26, 2001 8:26 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: [PHP-DB] reading a URL...




'ello,

Is it Possible, in PHP to read a URL?

What I am trying to do is this...
I have many news stories in a database, and a single static news page, that
calls the story, and the corresponding headline.
I have looked about on-line, and seen a common URL,...

http://www.arandomsite.com/news_story.php?id=123

I have adopted this method, and it only displays the top most story in my
database, no matter what news ID I use.

Can I get the ID number from the URL?, and then pass that to the SQL
statement?

I cannot find a tutorial or similar on-line anywhere.

Hope you can help,
Tris...

P.S, after getting this all set up, my boss asked me to turn everything into
.jsp pages.
SO, I am off to buy a "JSP in 20 seconds" Type books, any ideas?






**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.


**

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




Re: [PHP-DB] continuously view database updates.

2001-03-26 Thread Andreas D. Landmark

At 26.03.2001 15:44, you wrote:
Hi,
I am doing a college project which involves using PHP scripts to update a 
MySQL database. For demonstration purposes I would like the new updated 
table in my Database to be shown each time it is updates without me having 
to go to the command prompt window and type in select * from members; for 
example! I will have the command window open for the demo.
Thanks
Kev.

Live display of a mysql table isn't possible AFAIK, but you could fake it 
through
scripting og programming on your preferred platform, just do a select * 
from somewhere
statement every second (- put favorite interval there) and display it the 
way you
like it to be displayed...

PHP could do it, perhaps not the most effective solution, but certainly an easy
solution... use a persistant connection and HTTP-REFRESH or something, unless
you're dumping heavy work on the DB this should be fine, if we're talking 
high-performance
time-critical and or high-load stuff here, you might wanna look at 
somethingelse...


--
Andreas D. Landmark / noXtension
PGP ID:0xB2BEAE80 / 4096bits
Fingerprint:654B 3BCD 1130 9B3A 08BB  AB1A BF72 841D B2BE AE80


-- 
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] continuously view database updates.

2001-03-26 Thread Rubanowicz, Lisa

HI Kevin,
you are the first Irish person I have seen on this list!!
Anyhow, When you submit the form insure that the form submits to itself so
you don't have to worry about a refresh. On the top of the page have the
form and below do the select statement to show what is in the table. When
the form is submitted to itself it will run the select statement again and
show the latest data.

Here is some code for a complete page that can be seen at
http://www.navanwebdesign.com/php/admin/index.php
Please feel free to mess around with it.  I am a beginner too so to get a
file that does all can be so helpful.  However because I am a beginner this
may not be the most effective way of doing it.
All the Best
Lisa


?

$host="";
$user="";
$password="";
$dbasename="";

mysql_pconnect("$host","$user","$password")
or die("Unable to connect to SQL server");
mysql_select_db("$dbasename") or die("Unable to select database");

if ($delete) {

// delete a record

$sql1 = "DELETE FROM pages WHERE page_id=$page_id";
$result = mysql_query($sql1); 
$query="DELETE FROM page_creation WHERE page_id=$page_id"; 

$result = MYSQL_QUERY($query) OR die("There was an error!") ;


}
if ($edit) {

// delete a record

$sql1 = "SELECT FROM page_creation WHERE page_id=$page_id";
$result = mysql_query($sql1); 



}



if ($submit) {

$sql1 = "INSERT INTO page_creation values(NULL,'$page_name')";
$result = mysql_query($sql1); 
$query="select LAST_INSERT_ID() as page_id "; 

$result = MYSQL_QUERY($query) OR die("There was an error!") ;
while($row = mysql_fetch_array($result)) {
  $page_id=$row["page_id"];  
}
$sql2 = "INSERT INTO pages
(pg_id,page_id,pg_auction_title,pg_auction_date,pg_cat_no,pg_desc,pg_img_url
,pg_price)
values(NULL,'$page_id','$pg_auction_title','$pg_auction_date','$pg_cat_no','
" . str_replace("\n","br", $pg_desc) . "','$pg_img_url','$pg_price')"; 

$result2 = mysql_query($sql2); 
}


?

HTML
HEAD
SCRIPT
if (navigator.appName == "Netscape") {
StyleSheet = "netstyle.css"
} else {
StyleSheet = "iestyle.css"
}
/SCRIPT
SCRIPTdocument.write('link rel=stylesheet type="text/css" href="'
+StyleSheet + '"')/SCRIPT

TITLEAdd a Message/TITLE
/HEAD
SCRIPT
if (navigator.appName == "Netscape") {
StyleSheet = "netstyle.css"
} else {
StyleSheet = "iestyle.css"
}
/SCRIPT
SCRIPTdocument.write('link rel=stylesheet type="text/css" href="'
+StyleSheet + '"')/SCRIPT

BODY BGCOLOR="#FF" topmargin=0 leftmargin=0
 form method="post" action="?php echo $PHP_SELF?"
 TABLE WIDTH=700 CELLPADDING=0 CELLSPACING=0 BORDER=1
BORDERCOLOR="#C0C0C0"
 TRTD WIDTH=350 CLASS="content" VALIGN=TOP

 
input type=hidden name="id" value="?php echo $id ?"

FONT CLASS="header"Add a New Web Page
TABLE WIDTH=350 CELLPADDING=0 CELLSPACING=0 BORDER=1 BORDERCOLOR="#C0C0C0"
TRTD WIDTH=100 CLASS="label"Auction Page Name/TD
TD WIDTH=250 CLASS="label"input type="Text" name="page_name"
value="?php echo $page_name ?" CLASS="box"/TD
/TR
TRTD WIDTH=100 CLASS="label"Auction Title/TD
TD WIDTH=250 CLASS="label"input type="Text"
name="pg_auction_title" value="?php echo $pg_auction_title ?"
CLASS="box"/TD
/TR
TRTD WIDTH=100 CLASS="label"Auction Date/TD
TD WIDTH=250 CLASS="label"input type="Text"
name="pg_auction_date" value="?php echo $pg_auction_date ?"
CLASS="box"/TD

/TR
TRTD WIDTH=100 CLASS="label"Catologue Number/TD
TD WIDTH=250 CLASS="label"input type="Text" name="pg_cat_no"
value="?php echo $pg_cat_no ?" CLASS="box"/TD
/TR
TRTD WIDTH=100 CLASS="label"Catalog Entry Description/TD
TD WIDTH=250 CLASS="label"TEXTAREA name="pg_desc" COLS=30
ROWS=3?php echo $pg_desc ?/TEXTAREA/TD
/TR
TRTD WIDTH=100 CLASS="label"Catalog Entry Image URL/TD
TD WIDTH=250 CLASS="label"input type="Text" name="pg_img_url"
value="?php echo $pg_img_url ?" CLASS="box"/TD
/TR
TRTD WIDTH=100 CLASS="label"Catalog Entry Price/TD
TD WIDTH=250 CLASS="label"input type="Text" name="pg_price"
value="?php echo $pg_price ?" CLASS="box"/TD
/TR
TRTD COLSPAN=2 CLASS="label"CENTERinput type="Submit" name="submit"
value="Enter information" CLASS="box"/TD
/TR
/TABLE
/form
/TD
TD WIDTH=350 CLASS="content" VALIGN=TOP
FONT CLASS="header"Edit Web Page

TABLE WIDTH=350 CELLPADDING=0 CELLSPACING=0 BORDER=1 BORDERCOLOR="#C0C0C0"
TRTD WIDTH=200 CLASS="label"Edit Auction Page/TD
TD WIDTH=75 CLASS="label"Edit page Title/TD
TD WIDTH=75 CLASS="label"Delete page Title/TD
/TR
 
  TABLE WIDTH=100% BORDER=1
 ? // editing so select a record
$sql = "SELECT * FROM page_creation";
$result=mysql_query($sql);
//$myrow=mysql_fetch_array($result);
$page_id=$myrow["page_id"];
$page_name=$myrow["page_name"];

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


RE: [PHP-DB] reading a URL...

2001-03-26 Thread Brunner, Daniel

Hello 

Try to use this one with mysql_fetch_object...


printf ("TD WIDTH=80a href=\"%s?Art_Job_Number=%s\"%s
%s/a\n","list.php", $data-Art_Job_Number, "BEdit/B",
"BView/B");

Then on the list.php do a select statement like this

query = "SELECT * FROM Table1 WHERE Art_Job_Number = $Art_Job_Number";



Then echo the result and you should then have what you want...

Unless I'm missing the whole point!!

Dan









 --
 From: [EMAIL PROTECTED]
 Sent: Monday, March 26, 2001 8:26 AM
 To:   [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject:  [PHP-DB] reading a URL...
 
 
 
 'ello,
 
 Is it Possible, in PHP to read a URL?
 
 What I am trying to do is this...
 I have many news stories in a database, and a single static news page,
 that
 calls the story, and the corresponding headline.
 I have looked about on-line, and seen a common URL,...
 
 http://www.arandomsite.com/news_story.php?id=123
 
 I have adopted this method, and it only displays the top most story in
 my
 database, no matter what news ID I use.
 
 Can I get the ID number from the URL?, and then pass that to the SQL
 statement?
 
 I cannot find a tutorial or similar on-line anywhere.
 
 Hope you can help,
 Tris...
 
 P.S, after getting this all set up, my boss asked me to turn
 everything into
 .jsp pages.
 SO, I am off to buy a "JSP in 20 seconds" Type books, any ideas?
 
 
 
 
 
 
 **
 This email and any files transmitted with it are confidential and
 intended solely for the use of the individual or entity to whom they
 are addressed. If you have received this email in error please notify
 the system manager.
 
 This footnote also confirms that this email message has been swept by
 MIMEsweeper for the presence of computer viruses.
 
 
 **
 
 -- 
 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]




RE: [PHP-DB] reading a URL...

2001-03-26 Thread Rubanowicz, Lisa

Which I think I must have been!!
Lisa

-Original Message-
From: Brunner, Daniel [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 26, 2001 4:07 PM
To: '[EMAIL PROTECTED]'
Cc: '[EMAIL PROTECTED]'
Subject: RE: [PHP-DB] reading a URL...


Hello 

Try to use this one with mysql_fetch_object...


printf ("TD WIDTH=80a href=\"%s?Art_Job_Number=%s\"%s
%s/a\n","list.php", $data-Art_Job_Number, "BEdit/B",
"BView/B");

Then on the list.php do a select statement like this

query = "SELECT * FROM Table1 WHERE Art_Job_Number = $Art_Job_Number";



Then echo the result and you should then have what you want...

Unless I'm missing the whole point!!

Dan









 --
 From: [EMAIL PROTECTED]
 Sent: Monday, March 26, 2001 8:26 AM
 To:   [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Subject:  [PHP-DB] reading a URL...
 
 
 
 'ello,
 
 Is it Possible, in PHP to read a URL?
 
 What I am trying to do is this...
 I have many news stories in a database, and a single static news page,
 that
 calls the story, and the corresponding headline.
 I have looked about on-line, and seen a common URL,...
 
 http://www.arandomsite.com/news_story.php?id=123
 
 I have adopted this method, and it only displays the top most story in
 my
 database, no matter what news ID I use.
 
 Can I get the ID number from the URL?, and then pass that to the SQL
 statement?
 
 I cannot find a tutorial or similar on-line anywhere.
 
 Hope you can help,
 Tris...
 
 P.S, after getting this all set up, my boss asked me to turn
 everything into
 .jsp pages.
 SO, I am off to buy a "JSP in 20 seconds" Type books, any ideas?
 
 
 
 
 
 
 **
 This email and any files transmitted with it are confidential and
 intended solely for the use of the individual or entity to whom they
 are addressed. If you have received this email in error please notify
 the system manager.
 
 This footnote also confirms that this email message has been swept by
 MIMEsweeper for the presence of computer viruses.
 
 
 **
 
 -- 
 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]



RE: [PHP-DB] reading a URL...

2001-03-26 Thread Tristan . Pretty



I am a newbie, so I gotta admit that most of that went over my head, hit a brick
wall, and is now residing in the big server in the sky.

If you go to:
http://www.pcformat.co.uk

Select news, and then any article, and if you look at the URL, you'll see the
result I'm trying to achieve.
They've done it in ASP, but the result is what I want...
Any ideas?
Tris...





Hello 

Try to use this one with mysql_fetch_object...


printf ("TD WIDTH=80a href=\"%s?Art_Job_Number=%s\"%s
%s/a\n","list.php", $data-Art_Job_Number, "BEdit/B",
"BView/B");

Then on the list.php do a select statement like this

query = "SELECT * FROM Table1 WHERE Art_Job_Number = $Art_Job_Number";



Then echo the result and you should then have what you want...

Unless I'm missing the whole point!!

Dan






 'ello,

 Is it Possible, in PHP to read a URL?

 What I am trying to do is this...
 I have many news stories in a database, and a single static news page,
 that
 calls the story, and the corresponding headline.
 I have looked about on-line, and seen a common URL,...

 http://www.arandomsite.com/news_story.php?id=123

 I have adopted this method, and it only displays the top most story in
 my
 database, no matter what news ID I use.

 Can I get the ID number from the URL?, and then pass that to the SQL
 statement?

 I cannot find a tutorial or similar on-line anywhere.

 Hope you can help,
 Tris...

 P.S, after getting this all set up, my boss asked me to turn
 everything into
 .jsp pages.
 SO, I am off to buy a "JSP in 20 seconds" Type books, any ideas?






 **
 This email and any files transmitted with it are confidential and
 intended solely for the use of the individual or entity to whom they
 are addressed. If you have received this email in error please notify
 the system manager.

 This footnote also confirms that this email message has been swept by
 MIMEsweeper for the presence of computer viruses.


 **

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







**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.


**

-- 
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] What's wrong with this code?

2001-03-26 Thread Emir Musabasic

Hi,

I really need help, I wrote a function so that I can
call for db user/password in an include file. It looks
like this:

// Connect to the database
function db_connect(){
global $MYSQL_USERNAME, $MYSQL_PASSWORD, $DB,
$HOST;
$db =
mysql_connect("$HOST","$MYSQL_USERNAME","$MYSQL_PASSWORD");
mysql_select_db("$DB",$db);
}

I have user/password/host variables inside a config
file but for some reason when I include this into a
php page when I test it, I get:

Fatal error: Cannot redeclare db_connect() in
/www/affiliate/include/functions.inc on line 7.

Am I missing something because everything looks good
to me.

Emir.

__
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.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]




RE: [PHP-DB] What's wrong with this code?

2001-03-26 Thread Brunner, Daniel

Hello...

Try mysql_pconnect instead

Dan



 --
 From: Emir Musabasic
 Sent: Monday, March 26, 2001 9:34 AM
 To:   [EMAIL PROTECTED]
 Subject:  [PHP-DB] What's wrong with this code?
 
 Hi,
 
 I really need help, I wrote a function so that I can
 call for db user/password in an include file. It looks
 like this:
 
 // Connect to the database
 function db_connect(){
 global $MYSQL_USERNAME, $MYSQL_PASSWORD, $DB,
 $HOST;
 $db =
 mysql_connect("$HOST","$MYSQL_USERNAME","$MYSQL_PASSWORD");
 mysql_select_db("$DB",$db);
 }
 
 I have user/password/host variables inside a config
 file but for some reason when I include this into a
 php page when I test it, I get:
 
 Fatal error: Cannot redeclare db_connect() in
 /www/affiliate/include/functions.inc on line 7.
 
 Am I missing something because everything looks good
 to me.
 
 Emir.
 
 __
 Do You Yahoo!?
 Get email at your own domain with Yahoo! Mail. 
 http://personal.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]
 
 

-- 
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/MySQL Program

2001-03-26 Thread Rubanowicz, Lisa

I haven't used it yet but had it book marked.
Try out www.codecharge.com
It is not free but only $149
All the Best
Lisa
PS Let me know how you get on.

-Original Message-
From: Jason Stechschulte [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 26, 2001 5:13 PM
To: Angela Curtis
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] PHP/MySQL Program


On Fri, Mar 23, 2001 at 07:05:35PM -0500, Angela Curtis wrote:
 I have a client who would like to make some simple database-driven pages
 using PHP and MySQL, but he doesn't know how to use either.  He asked me
 if there was a program that he could use to create pages that would be
 easier than having to learn both PHP and MySQL.  I've always done
 everything from scratch, so I didn't have any idea if there was such a
 program.  If anyone knows of something I could suggest, I would greatly
 appreciate it.
 Thanks for any suggestions!
 -Angela

I'm not sure if there are any programs.  PHP and MYSQL are really easy
to learn and work extremely well together.  I would encourage your
client to learn them.  It will be well worth the effort.
-- 
Jason Stechschulte
[EMAIL PROTECTED]
--
No, that'd be silly.
 -- Larry Wall in [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-DB] error and general problems

2001-03-26 Thread Liz Bander

I am getting a parse error for the return line every time I try and view 
the page.   Can anyone tell me why?  The code is below.

$results = "select req, source, number from orders where req=" . 
$GLOBALS["req"] . ", source=" . $GLOBALS["source"] . ",
number=" .$GLOBALS["req"] . "";

if (mysql_fetch_row($results) != 0) {
 return "This has already been added.";

Also (since this is part of the problem, I'm sure) how do I take the 
$GLOBALS values and set them equal to the req and source values in the 
select statement?  Is this syntax correct?  The $GLOBALS values are pulled 
earlier from a similar select statement.

Thanks,

Liz


-- 
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] Error Control

2001-03-26 Thread CC Zona

In article [EMAIL PROTECTED],
 [EMAIL PROTECTED] ("Jason Bell") wrote:

 Hello! I'm writing a script that validates a form It creates users in a
 mysql table, where there are 2 unique columns 'username' and 'email'.
 
 I'm putting mysql_error() into a variable, but I don't want the end user to
 see that particular message... is there a way to look at just the key that
 has been duplicated, and create a custom error message for user display?
 
 for example, when I duplicate a username, 'jbell', I get this from
 mysql_error() : "Duplicate entry 'jbell' for key 2"
 
 I want to be able to see that the error is from key 2, and react
 accordingly

From a MySQL perspective, you could adjust the query so no error is 
generated.  See the syntax for "INSERT IGNORE" or "REPLACE" for instance.

From a PHP perspective, there are functions such as set_error_handler() or 
register_shutdown_function() to deal with such issues.

http://www.php.net/manual/en/features.error-handling.php
http://www.php.net/manual/en/ref.errorfunc.php
http://www.php.net/manual/en/function.register-shutdown-function.php

-- 
CC

-- 
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's wrong with this code?

2001-03-26 Thread CC Zona

In article [EMAIL PROTECTED],
 [EMAIL PROTECTED] (Emir Musabasic) wrote:

 I have user/password/host variables inside a config
 file but for some reason when I include this into a
 php page when I test it, I get:
 
 Fatal error: Cannot redeclare db_connect() in
 /www/affiliate/include/functions.inc on line 7.
 
 Am I missing something because everything looks good
 to me.

Try using include_once() instead of include().  You're probably 
inadvertantly re-including the file.  In general, except where you're 
deliberately making multiple includes of the same file, it's a good idea to 
get in the habit of using include_once() or require_once() to save yourself 
from surprises like this.

-- 
CC

-- 
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] error and general problems

2001-03-26 Thread CC Zona

In article [EMAIL PROTECTED],
 [EMAIL PROTECTED] (Liz Bander) wrote:

 I am getting a parse error for the return line every time I try and view 
 the page.   Can anyone tell me why?  The code is below.
 
 $results = "select req, source, number from orders where req=" . 
 $GLOBALS["req"] . ", source=" . $GLOBALS["source"] . ",
   number=" .$GLOBALS["req"] . "";
 
 if (mysql_fetch_row($results) != 0) {
  return "This has already been added.";

Is this inside a function?  'Cuz AFAIK a "return" would only make sense 
inside a function.  

FWIW, the comparison of the fetched row to zero strikes me as a bit 
unusual.  Are you just checking whether there was no rows were returned by 
the query?  If so, I suspect that checking mysql_num_rows() would be more 
efficient.

 Also (since this is part of the problem, I'm sure) how do I take the 
 $GLOBALS values and set them equal to the req and source values in the 
 select statement?  Is this syntax correct?

Depends.  MySQL needs string values quoted too, so if for example all of 
those variables are strings you'd do something like:

$results = "select req, source, number from orders where req='" . 
$GLOBALS["req"] . "', source='" . $GLOBALS["source"] . ", number='" . 
$GLOBALS["req"] . "'";

-- 
CC

-- 
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] MySQL for Billng Question

2001-03-26 Thread Jeff Oien

I want to have a database for my hours for my clients.
I want to create a report where it shows only the hours
back to the last time I was paid. I have no idea how to
go about this. Any help would be appreciated.

Jeff Oien
PHP start here
http://www.webdesigns1.com/php/

-- 
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] reading a URL...

2001-03-26 Thread CC Zona

In article [EMAIL PROTECTED],
 [EMAIL PROTECTED] wrote:

 Is it Possible, in PHP to read a URL?
 
 What I am trying to do is this...
 I have many news stories in a database, and a single static news page, that
 calls the story, and the corresponding headline.
 I have looked about on-line, and seen a common URL,...
 
 http://www.arandomsite.com/news_story.php?id=123
 
 I have adopted this method, and it only displays the top most story in my
 database, no matter what news ID I use.
 
 Can I get the ID number from the URL?, and then pass that to the SQL 
 statement?

Yes to both, and quite easily.  All the variables passed in a GET request 
(which is what the url is) will automatically be made available in the 
$HTTP_GET_VARS associative array.  So variable "id" is at 
$HTTP_GET_VARS['id'].  In addition, if the configuration setting 
"register_globals" is turned on, the variable will also be accessible 
simply as $id.

So in the script news_story.php, you could write a query string like, for 
example:

"SELECT article_text from story_table where id=$id"

or

"SELECT article_text from story_table where id=" .
$HTTP_GET_VARS['id']

See http://www.php.net/manual/en/language.variables.external.php

-- 
CC

-- 
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] Tree structures...

2001-03-26 Thread Miles Thompson


Richard comes through again  --- in spades!!

Miles

At 09:35 AM 3/26/01 +0100, [EMAIL PROTECTED] wrote:
You may want to check out my tutorial on recursively processing this
sort of structure on the easysoft website:

http://www.easysoft.com/tech/php/tut_002/main.phtml

Hope this helps

   _

~ Richard Allsebrook ~
Applications Developer and Webmaster
Easysoft Limited, Thorp Arch Grange, Thorp Arch, Wetherby, LS23 7BA, UK
http://www.easysoft.com http://www.easysoft.com  -
http://www.cinema.com http://www.cinema.com
"A computer lets you make more mistakes faster than any invention in
human history - with the possible exceptions of handguns and tequila."

   _





-Original Message-
From: antiphobo [mailto:[EMAIL PROTECTED]]
Sent: Saturday, March 24, 2001 11:28 AM
To: php-db
Cc: antiphobo
Subject: FW: [PHP-DB] Tree structures...


What's the best way to deal with tree structures? Use the following
setup in
a database as an example:

ID | Parent | Description

1 ||   Colours
2 |1   |  Red
3 ||   Hello
4 |1   |  Green
5 | 4  |  Light
6 | 4  |  Dark


This should be represented as:

1. Colours
4.   +--Green
6.   +--Dark
5.   +--Light
2.   +--Red
3. Hello

(ie, in tree structure and ordered alphabetically by 'descriptiu

What's the best way to select the data and render it in HTML?

I thought about going thru each element (of the whole table) at a time,
and
making an array, dynamically adding bits of the tree together until the
whole tree has been grown ... but it seems a little bit complicated and
slow
... is there anything that could be done [database]server-side which
might
help me?

Or do other people have code snippets, ideas or anything which might
help
me??

Thanks,

Siggy




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




Re: [PHP-DB] PHP/MySQL Program

2001-03-26 Thread olinux

I would suggest going to www.hotscripts.com
they have a marvelous collection of all sorts of scripts - content
management, database crap, pretty much everything.
I think that if actually learning the PHP, mySQL  is not going to happen
these scripts would work quite well

olinux

- Original Message -
From: "Jason Stechschulte" [EMAIL PROTECTED]
To: "Angela Curtis" [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, March 26, 2001 8:12 AM
Subject: Re: [PHP-DB] PHP/MySQL Program


 On Fri, Mar 23, 2001 at 07:05:35PM -0500, Angela Curtis wrote:
  I have a client who would like to make some simple database-driven pages
  using PHP and MySQL, but he doesn't know how to use either.  He asked me
  if there was a program that he could use to create pages that would be
  easier than having to learn both PHP and MySQL.  I've always done
  everything from scratch, so I didn't have any idea if there was such a
  program.  If anyone knows of something I could suggest, I would greatly
  appreciate it.
  Thanks for any suggestions!
  -Angela

 I'm not sure if there are any programs.  PHP and MYSQL are really easy
 to learn and work extremely well together.  I would encourage your
 client to learn them.  It will be well worth the effort.
 --
 Jason Stechschulte
 [EMAIL PROTECTED]
 --
 No, that'd be silly.
  -- Larry Wall in [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]


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




[PHP-DB] Getting info from remote host

2001-03-26 Thread ryan_gamo

An outside host cgi script outputs some information, in this case - stock
price.

They output in plain ascii, stock price and last update on two separate
lines.

Would PHP be able to request the info from the CGI [it's a URL] and output
it onto a page?

I asked this here just in case there was some database temporary storage
ideas out there too.

My idea was to make the http request and load it into an array, to be
output in a PHP page.


Thanks,
Ryan


-- 
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 for Billng Question

2001-03-26 Thread Cal Evans

Jeff,

Check www.freshmeat.net  There are a couple of packages out there that
already do this. Some of them use MySQL.  If nothing else, you can borrow
their database schema.

Cal
http://www.calevans.com


-Original Message-
From: Jeff Oien [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 26, 2001 11:45 AM
To: PHP-DB
Subject: [PHP-DB] MySQL for Billng Question


I want to have a database for my hours for my clients.
I want to create a report where it shows only the hours
back to the last time I was paid. I have no idea how to
go about this. Any help would be appreciated.

Jeff Oien
PHP start here
http://www.webdesigns1.com/php/

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




Re: [PHP-DB] Getting info from remote host

2001-03-26 Thread CC Zona

In article [EMAIL PROTECTED],
 [EMAIL PROTECTED] wrote:

 My idea was to make the http request and load it into an array, to be
 output in a PHP page.

http://www.php.net/manual/en/function.file.php

-- 
CC

-- 
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] table 1 to table 2

2001-03-26 Thread Tobe Johnson

Using PHP, I need to run a query against one MySQL database table (table1) 
and transfer the results into another identical MySQL database table 
(table2).  Am I simply overlooking something simple on how to do this?  Can 
someone give me input or direction on the best way to do this?

Thanks in advance

Tobe

-- 
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] table 1 to table 2

2001-03-26 Thread Cal Evans

insert into table2 Select * from table1 where myConditionIsMet;


Cal
http://www.calevans.com


-Original Message-
From: Tobe Johnson [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 26, 2001 1:41 PM
To: PHP-DB
Subject: [PHP-DB] table 1 to table 2


Using PHP, I need to run a query against one MySQL database table (table1)
and transfer the results into another identical MySQL database table
(table2).  Am I simply overlooking something simple on how to do this?  Can
someone give me input or direction on the best way to do this?

Thanks in advance

Tobe

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




RE: [PHP-DB] Getting info from remote host

2001-03-26 Thread Brian Hardwick

I have done this by making a fsockopen call to the remote host (port 80),
request the page to be loaded using a http "get", read the returned page
into a buffer and parse through it for the information requested.

- Brian Hardwick
Tangible Networks


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 26, 2001 2:03 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Getting info from remote host


An outside host cgi script outputs some information, in this case - stock
price.

They output in plain ascii, stock price and last update on two separate
lines.

Would PHP be able to request the info from the CGI [it's a URL] and output
it onto a page?

I asked this here just in case there was some database temporary storage
ideas out there too.

My idea was to make the http request and load it into an array, to be
output in a PHP page.


Thanks,
Ryan


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




Re: [PHP-DB] MySQL for Billng Question

2001-03-26 Thread Andreas D. Landmark

At 26.03.2001 22:21, you wrote:
how bout something like this.

You have 3 columns
TOTAL_HOURS | UNPAID_HOURS | LAST_PAID

when you are paid, update TOTAL_HOURS to add UNPAID_HOURS and clear [delete,
or set to zero] the UNPAID_HOURS column... LAST_PAID would be type =
timestamp, or date.
You could get pretty elaborate, and mySQL can do a TON of cool tricks with
the numbers... depends what your uses may be. If you are using it to
generate statements it may be worth more time than simply "keeping track"

I picked up SAM'S learn SQL in 10 minutes. I really liked it, considering
that I don't need to use a whole lot of mySQL functions, it's a wonderful
little reference and I have learned some neat things real fast.  I
understand that it is far from "complete" but i feel it is worth it for me
[starting out]

olinux

I'd rather go for something like one field for date, one for hours worked, 
one for
paid and one for date paid, this way you could keep track of _when_ you worked
and didn't get paied, it's much easier and better in the long run than just 
having
the number of hours they owe you... (this way you could calculate number of
hours you work per week etc.).


--
Andreas Landmark / [EMAIL PROTECTED]
"If you are too low a lifeform to be able to learn how to use the
manual page subsystem, why should we help you?" (Theo de Raadt)


-- 
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 grant problem?

2001-03-26 Thread Jason Stechschulte

On Sat, Mar 24, 2001 at 11:22:37PM +0800, Fai wrote:
 When we use grant as following:
 GRANT select(col_name_1) on db_name_1.tbl_name_1 to peter identified by
 "peter";
 
 Then peter can only select the field of col_name_1 on the tbl_name_1 of
 db_name_1.
 
 However, when peter issue the query: DESC tbl_name_1; he can see all the
 structure of that table. This makes that peter does not know which column he
 can use.
 
 Does any body know how to make peter only can see the column which he has
 right to use it when he issue DESC tbl_name_1.

I'm not sure but I think this is a question that should have been posted
to a Mysql list.  

[EMAIL PROTECTED]

-- 
Jason Stechschulte
[EMAIL PROTECTED]
--
OOPS!  You naughty creature!  You didn't run Configure with sh!
I will attempt to remedy the situation by running sh for you...
 -- Larry Wall in Configure from the perl distribution

-- 
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] PostgreSQL and PHP - some Great Bridge news

2001-03-26 Thread Ned Lilly

All,

I'm pleased to announce two initiatives at Great Bridge aimed at 
improving the integration of PostgreSQL and PHP, and some exciting stuff 
that we're doing as a company to get behind PHP more fully.

First, Great Bridge is partnering with Zend Technologies to include a 
fully-integrated installation of PHP in an upcoming Web developer's 
edition of Great Bridge PostgreSQL.  In addition to 
professionally-supported PHP (and other open source Web technologies), 
we'll also give our customers the chance to purchase Zend's value-added 
PHP tools (IDE, cache, encoder, and more...)  Zend  is a major 
contributor to the open source PHP effort, and we're very happy to be 
working with them.

Secondly, we're pleased to announce that three PHP core developers have 
joined the Great Bridge advisory committee- Rasmus Lerdorf, the creator 
of PHP; Thies Arntzen, an expert in PHP-database connectivity; and 
Sascha Schumann, PHP author and provider of high-performance webchat 
solutions.  Rasmus, Thies, and Sascha will work with us to help craft 
our Web developer products and services, including (of course) a fully 
optimized free download package.  We'll be putting some development 
energy into the PHP-Postgres interface, and look for other ways the two 
open source projects can help each other.

We're also very interested in hacker feedback as to what you'd like to 
see in a software and service package that revolves around the Web 
development "stack."  What kind of tools, building blocks, and 
applications would you like to see commercially supported?  Don't be shy 
- please email me at [EMAIL PROTECTED] with any suggestions.  I'll 
also be at ApacheCon in a few weeks if you'd like to get together in person.

Thanks,
Ned

-- 

Ned Lilly e: [EMAIL PROTECTED]
Vice Presidentw: www.greatbridge.com
Evangelism / Hacker Relationsv: 757.233.5523
Great Bridge, LLCf: 757.233.


-- 
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] reading a URL...

2001-03-26 Thread Tristan . Pretty



'ello,

Is it Possible, in PHP to read a URL?

What I am trying to do is this...
I have many news stories in a database, and a single static news page, that
calls the story, and the corresponding headline.
I have looked about on-line, and seen a common URL,...

http://www.arandomsite.com/news_story.php?id=123

I have adopted this method, and it only displays the top most story in my
database, no matter what news ID I use.

Can I get the ID number from the URL?, and then pass that to the SQL statement?

I cannot find a tutorial or similar on-line anywhere.

Hope you can help,
Tris...

P.S, after getting this all set up, my boss asked me to turn everything into
.jsp pages.
SO, I am off to buy a "JSP in 20 seconds" Type books, any ideas?






**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.


**

-- 
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] reading a URL...

2001-03-26 Thread richarda
 BDY.RTF

-- 
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] Apache + php4 + pdflib + win32

2001-03-26 Thread Osman Omar

Hi,
Can I use pdflib on win32 platform using apache and php4?

if can how?

thanks


-- 
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] Code for adding,edit and deleting records

2001-03-26 Thread Jim Ray

I am looking for some code that will allow a user to add, edit and delete
records in a MySql table.  Does someone know of site where I can see how to
do this in a nice format?

Thank you.

Jim



-- 
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] How to print last row in an array using WHILE?

2001-03-26 Thread Bob Stone

Dear PHP Helpers,

I have an array created by an mysql select statement.

I have the code to display the "rows" from the select
statement.

Everything works fine except that only n-1 rows from
the array will display.

For example if the array contains four rows only three
will display. If the array contains one row, nothing
displays on the screen.

I understand that a WHILE loop will count down to zero
and then since it becomes false will quit, but how do
I get the last (or first) row to print?

Here is the code:

HTML

HEAD

TITLE/TITLE

/HEAD

BODY BGCOLOR="#FF" TEXT="#00" LINK="#FF"
VLINK="#800080"

?php

$db = mysql_connect("localhost" , "phpuser" ,
"phpuser");

mysql_select_db("SVT",$db);

// display individual record

if ($user_name) {

$result = mysql_query("SELECT * FROM svt_members
WHERE user_name='$user_name'",$db);

$myrow = mysql_fetch_array($result);

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

printf("Full Name: bfont color=\"green\"
size=\"5\"%s %s %s %s\nbr/b/font",
$myrow["salutation"], $myrow["first_name"],
$myrow["mid_name"], $myrow["user_name"]);

printf("Credentials and Degrees: bfont
color=\"blue\" size=\3\"%s/font/b   Job Title:
bfont color=\"blue\"
size=\3\"%s/font/bbrCompany/Institution:
bfont color=\"blue\"
size=\3\"%sbr/font/bAddress: bfont
color=\"blue\" size=\3\"%s %sbr/font/bCity:
bfont color=\"blue\" size=\3\"%s/font/b  
State/Provence: bfont color=\"blue\"
size=\3\"%sbr/font/bCountry: bfont
color=\"blue\" size=\3\"%s/font/b   Postal Code:
bfont color=\"blue\"
size=\3\"%sbr/font/bVoice: bfont
color=\"blue\" size=\3\"%s/font/b   Fax: bfont
color=\"blue\" size=\3\"%sbr/font/bE-mail:
bfont color=\"blue\" size=\3\"%s\nP/b/font",
$myrow["cert_deg"], $myrow["job_title"],
$myrow["institution"], $myrow["address_1"],
$myrow["address_2"], $myrow["geo_loc"],
$myrow["state"], $myrow["country"], $myrow["zip"],
$myrow["phone"], $myrow["fax"], $myrow["e_mail"]);

} 

}
?

form method="post" action="?php echo $PHP_SELF ?"

Enter Last Name To Search:  input type="Text"
name="user_name"p

input type="Submit" name="submit" value="Click To
Search"

/form

/BODY

/HTML

Thank you very much for your help.

Best regards,

Bob Stone

__
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/?.refer=text

-- 
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 to print last row in an array using WHILE?

2001-03-26 Thread Felix Kronlage

On Mon, Mar 26, 2001 at 10:35:37PM -0800, Bob Stone wrote:

 Everything works fine except that only n-1 rows from
 the array will display.

no wonder (explained below at the code)

This fetches the first row
   $myrow = mysql_fetch_array($result);

...and then the rest in the while-loop. You need to take out
the first '$myrow = mysql_fetch_array($result);'
   while ($myrow = mysql_fetch_array($result)) {
 
   } 

should work then.
-fkr
-- 
gpg-fingerprint: 076E 1E87 3E05 1C7F B1A0  8A48 0D31 9BD3 D9AC 74D0 
  |http://www.hazardous.org/ | whois -h whois.ripe.de FKR-RIPE  |
  |all your base are belong to us  |  shame on me  | fkr@IRCnet | 

 PGP signature


[PHP-DB] Indexing help

2001-03-26 Thread M. Verheijen

Dear reader,
A newbie mysql/php-question here! I've filled a mysql-database with about 1600 
records. All these records contain items which
are on sale on a website. Every row contains an integer defining the category to which 
a item belongs.

At the left of the website there are buttons linked to a php-page which does a 
selection like this:
select * from PRODUCTS where SUBCODE = \"$SUBCODE\"

As you might have guessed, every button is a link in the form of:
a href="products.php?SUBCODE=8"img src="../button2.gif" border="0"/a

This all works well, but now my questions!
Is it wise to make an index for the integer column? I assume it is because it's the 
row almost all queries are using in there where-statements. What kind of speed 
increase can I expect, will it increase the speed of query's if the workload goes to 
2000 queries a hour? What's the best way to make this index, how does it works.

I've read about the use of indexes in the mysql-manual and phpbuilder.net, but both 
are kind of short and don't tell what
you're doing exactly. Anybody of you have some pointers to good webresources about 
indexing.

Yes, I know a long list of questions ;) I hope that some of you can give me a clue or 
two.

With best regards,
Maarten Verheijen


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