[PHP-DB] Re: Nested SQL query problem...

2002-05-29 Thread Zubarev Andrey

Hello Srini,

Don't speak english! :-)

For example, what is the cost of 500 licenses of Product_ID 143 ?
The slabs do not continue for an infinite number, hence I may only have slab
pricing for 1-10, 11-100, and 101-200 with the assumption that if there are
no higher slabs and I wanted say the rate for 500 licenses, I would use the
highest slab unit available, in this case the 101-200 slab.
My table structure is like so:
Slab_Master
++-+--+-+-++
| Field  | Type| Null | Key | Default | Extra  |
++-+--+-+-++
| TInt_SlabID| int(11) |  | PRI | NULL| auto_increment |
| TInt_ProductID | int(11) | YES  | | NULL||
| TInt_StartSlab | int(11) | YES  | | NULL||
| TInt_EndSlab   | int(11) | YES  | | NULL||
| TDbl_SlabRate  | float(10,2) | YES  | | NULL||
++-+--+-+-++

SKIP

SELECT TDbl_SlabRateFROM Slab_Master WHERE TInt_ProductID = 143
 AND TInt_StartSlab = 101; /*$MAX = 101*/

My examples:

CREATE TABLE wm
(
   id int(3) unsigned default '0',
   tex char(24) default NULL,
   lic tinyint(3) unsigned default NULL
)

INSERT INTO wm VALUES(1,  w,   6);
INSERT INTO wm VALUES(2,  zz,  20);
INSERT INTO wm VALUES(1,  www, 5);
INSERT INTO wm VALUES(1,  ww,  7);
INSERT INTO wm VALUES(5,  z,   2);
INSERT INTO wm VALUES(80, zzz, 1);


My query:

SELECT a.id, a.tex, MAX(a.lic) AS licens
FROM wm a, wm b
WHERE a.id=1 AND a.id=b.id AND a.lic60
GROUP BY a.id, a.tex
HAVING MAX(a.lic)=MAX(b.lic)
   ^
   
Result: MAX licens = 7

-- 
Best regards,
 Zubarev Andrey
 mailto:[EMAIL PROTECTED]
 miranda-icq: 115959232
 DelphiKingdom Team [http://www.delphikingdom.com]
 KZ - Ekibastuz


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




[PHP-DB] variables gone?

2002-05-29 Thread Rob Fraser

Dear All,
I am probably doing something silly but I don't know what (story of my
life). I have just upgraded to 4.2.1 and now all the variables I post in
forms or in query strings are now coming up undefined errors and are in
absent. I'm running PHP under IIS 4.
What am I doing wrong?

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




Re: [PHP-DB] variables gone?

2002-05-29 Thread Ed Gorski

In php.ini you need to turn register_globals on..you also might want to 
start using the $_GET, $_POST, $_SESSION global arrays

ed

At 02:49 PM 5/29/2002 +0100, Rob Fraser wrote:
Dear All,
I am probably doing something silly but I don't know what (story of my
life). I have just upgraded to 4.2.1 and now all the variables I post in
forms or in query strings are now coming up undefined errors and are in
absent. I'm running PHP under IIS 4.
What am I doing wrong?

--
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] REGEX help.

2002-05-29 Thread Jason Wong

On Wednesday 29 May 2002 06:55, Kevin Stone wrote:
 All I need to do is return anything matching the following pattern from a
 specific column in a table.   This is how I'd write it in PHP if I were
 pulling the data from string.  The string in this example is a direct copy
 of one of the column fields..

 ?
 $str = teaspoon_3 legends_3 lore_3 einstein_3 recipes_2 cups_2 plaster_2
 paris_2;

 // Search for einstein in the string and return the number associated with
 that word.
 preg_match_all('einstein_(\d)', $str, $matches);
 ?

 What would be the SQL equivilant?  I hate to seek a hand out here.. but I'm
 struggling with SQL REGEX and there just aren't as many good examples out
 there as there are for PHP.  The MySQL manual wasn't much help that's for
 sure. :-\

It doesn't seem possible. The MySQL REGEXP only returns a 1 or 0 to indicate a 
match or no match.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *


/*
You can't cheat an honest man.  Never give a sucker an even break or
smarten up a chump.
-- W.C. Fields
*/


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




[PHP-DB] multiple queries

2002-05-29 Thread Natividad Castro

Hi to all,
I have a search form where users can search project by 'Project Name' after
they type in the project name, they will select which project they will like
to view from a drop down menu which contains: Management Approve,
Pre-Approved, Management-Not-Approved, and Pre-Not-Approved pproved.

I'm using switch statement

switch ($project)
{
  case Management Approve
  $sql = mysql_query(select * from project where project_name='$pro_name'
and final_approved='yes');
   $result = mysql_query($sql);
   $record_count = mysql_num_rows($result);

case Pre-Approved:

$sql2 = mysql_query(select * from project where project_name='$pro_name'
and first_approved='yes');
 $result2 = mysql_query($sql2);
 $record_count2 = mysql_num_rows($result2);

and so on...

My question is: how do I call $sql, or $sql2, and $result, or $result2 to
loop and put the fields into an array? The reason I'm asking is because the
users will be able to navegate through the recordset, so I need to call just
the query that match the criteria either '$result' or '$result2' to be able
to display the right information.

e.g.,
while($query_data = mysql_fetch_array($result)) //it can be $result2
 {
 $project_id = $query_data[project_id];
 $project_name = $query_data[project_name];
}

I'm not sure if this explanation make sence to you guys, but if anybody
would like to take the time and try to help me out, that would be great

Thanks in advanced
Nato


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




RE: [PHP-DB] variables gone?

2002-05-29 Thread Mark Roedel


Beginning in PHP 4.2.0, the normal behavior with respect to preloaded
variables was changed (specifically, the default value of the
register_globals configuration entry was changed from on to off).

For details, see
http://www.php.net/manual/en/language.variables.predefined.php


---
Mark Roedel   | Blessed is he who has learned to laugh
Systems Programmer|  at himself, for he shall never cease
LeTourneau University |  to be entertained.
Longview, Texas, USA  |  -- John Powell


 -Original Message-
 From: Rob Fraser [mailto:[EMAIL PROTECTED]] 
 Sent: Wednesday, May 29, 2002 8:49 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] variables gone?
 
 
 I am probably doing something silly but I don't know what (story of
 my life). I have just upgraded to 4.2.1 and now all the variables I
 post in forms or in query strings are now coming up undefined errors 
 and are in absent. I'm running PHP under IIS 4.

 What am I doing wrong?

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




[PHP-DB] dropping one word from column entries

2002-05-29 Thread Jen Swofford

I'm having a problem with this and suppose I'm looking for a handout.  :|

I am displaying names of product categories.  The names of the categories
are:

Bird Cages
Cat Toys
Chinchilla Housing Products
Dog Leashes
Ferret Housing Products
Mouse Housing Products

What I want to do when displaying the names is to drop Products whenever
it appears.  What I want do display on the page instead is:

Bird Cages
Cat Toys
Chinchilla Housing
Dog Leashes
Ferret Housing
Mouse Housing

And no, changing the names of the categories in the database is not an
option.  :)  I'm completely missing the boat on this one... any help?

Jen Swofford
[EMAIL PROTECTED]




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




[PHP-DB] Re: multiple queries

2002-05-29 Thread Dan Koken

What's wrong with this or something similar:

$sql= mysql_query(
SELECT 
*
FROM 
project
WHERE 
project_name 
= '$pro_name'
AND (   final_approved  = 'yes' AND '$project' = 'Management Approve'
  ORfirst_approved  = 'yes' AND '$project' = 'Pre-Approved'
  ORect...
;

$result = mysql_query($sql);
$record_count = mysql_num_rows($result);
HTH
Good luck Dan..
===

Natividad Castro wrote:

 Hi to all,
 I have a search form where users can search project by 'Project Name' after
 they type in the project name, they will select which project they will like
 to view from a drop down menu which contains: Management Approve,
 Pre-Approved, Management-Not-Approved, and Pre-Not-Approved pproved.
 
 I'm using switch statement
 
 switch ($project)
 {
   case Management Approve
   $sql = mysql_query(select * from project where project_name='$pro_name'
 and final_approved='yes');
$result = mysql_query($sql);
$record_count = mysql_num_rows($result);
 
 case Pre-Approved:
 
 $sql2 = mysql_query(select * from project where project_name='$pro_name'
 and first_approved='yes');
  $result2 = mysql_query($sql2);
  $record_count2 = mysql_num_rows($result2);
 
 and so on...
 
 My question is: how do I call $sql, or $sql2, and $result, or $result2 to
 loop and put the fields into an array? The reason I'm asking is because the
 users will be able to navegate through the recordset, so I need to call just
 the query that match the criteria either '$result' or '$result2' to be able
 to display the right information.
 
 e.g.,
 while($query_data = mysql_fetch_array($result)) //it can be $result2
  {
  $project_id = $query_data[project_id];
  $project_name = $query_data[project_name];
 }
 
 I'm not sure if this explanation make sence to you guys, but if anybody
 would like to take the time and try to help me out, that would be great
 
 Thanks in advanced
 Nato
 
 


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




Re: [PHP-DB] dropping one word from column entries

2002-05-29 Thread Ed Gorski

use:

$name=Mouse Housing Products;
$name=str_replace(Products,,$name);

also the RTFM() function works too

ed

At 11:06 AM 5/29/2002 -0500, Jen Swofford wrote:
I'm having a problem with this and suppose I'm looking for a handout.  :|

I am displaying names of product categories.  The names of the categories
are:

Bird Cages
Cat Toys
Chinchilla Housing Products
Dog Leashes
Ferret Housing Products
Mouse Housing Products

What I want to do when displaying the names is to drop Products whenever
it appears.  What I want do display on the page instead is:

Bird Cages
Cat Toys
Chinchilla Housing
Dog Leashes
Ferret Housing
Mouse Housing

And no, changing the names of the categories in the database is not an
option.  :)  I'm completely missing the boat on this one... any help?

Jen Swofford
[EMAIL PROTECTED]




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


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




[PHP-DB] Resource ID#2 ????

2002-05-29 Thread Jas

Ok here is my problem, I set this up so a user selects a name form a select
box and that name or $user_id is then  passed to this page so the user can
edit the contact info etc.  However it does not pull the selected $user_id
and place each field into my form boxes, all I get is a Resource ID #2.  Not
sure how I can over come this...

$table = auth_users;
 $record = @mysql_query(SELECT * FROM $table WHERE user_id =
'$user_id',$dbh);
$var_form .= table width=\100%\ border=\0\ cellpadding=\7\form
name=\$user_id\ method=\post\ action=\del_account.php\
  trtd width=\20%\ colspan=\2\bEdit Account
$user_id/b/td/tr
trtd width=\20%\First Name:/tdtd width=\80%\input
type=\text\ name=\$f_name\ size=\30\ maxlength=\30\
value=\$f_name\font class=\copyright\i.e. John/font/td/tr
trtd width=\20%\Last Name:/tdtd width=\80%\input
type=\text\ name=\$l_name\ size=\30\ maxlength=\30\
value=\$l_name\font class=\copyright\i.e. Doe/font/td/tr
  trtd width=\20%\Email:/tdtd width=\80%\input
type=\text\ name=\$email_addy\ size=\30\ maxlength=\30\
value=\$email_addy\font class=\copyright\i.e.
[EMAIL PROTECTED]/font/td/tr
trtd width=\20%\User Name:/tdtd width=\80%\input
type=\text\ name=\$un\ size=\30\ maxlength=\30\ value=\$un\font
class=\copyright\i.e. j-doe/font/td/tr
trtd width=\20%\Password:/tdtd width=\80%\input
type=\password\ name=\$pw\ size=\30\ maxlength=\30\font
class=\copyright\(password must be alpha-numeric, i.e.
pAs5w0rd)/font/td/tr
trtd width=\20%\Confirm Password:/tdtd
width=\80%\input type=\password\ name=\$pw\ size=\30\
maxlength=\30\font class=\copyright\please confirm password
entered/font/td/tr
trtd width=\20%\nbsp;/tdtd width=\80%\input
type=\submit\ name=\add\ value=\edit user\nbsp;nbsp;input
type=\reset\ name=\reset\ value=\reset\/td/tr
   /form/table;
echo $record;
} else {
blah blah
}
Thanks in advance,
Jas




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




Re: [PHP-DB] dropping one word from column entries

2002-05-29 Thread Stuart Dallas

Ed Gorski [EMAIL PROTECTED] wrote:
 use:
 
 $name=Mouse Housing Products;
 $name=str_replace(Products,,$name);
 
 also the RTFM() function works too

I'd also trim it to get rid of any extra spaces that are left:

$name = trim(str_replace(Products,,$name));

-- 
Stuart


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




Re: [PHP-DB] Resource ID#2 ????

2002-05-29 Thread Jason Wong

On Thursday 30 May 2002 00:17, Jas wrote:
 Ok here is my problem, I set this up so a user selects a name form a select
 box and that name or $user_id is then  passed to this page so the user can
 edit the contact info etc.  However it does not pull the selected $user_id
 and place each field into my form boxes, all I get is a Resource ID #2. 
 Not sure how I can over come this...

 $table = auth_users;
  $record = mysql_query(SELECT * FROM $table WHERE user_id =
 '$user_id',$dbh);

Make liberal use of error checking (see manual) and mysql_error().

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *


/*
grep me no patterns and I'll tell you no lines.
*/


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




[PHP-DB] FW: hello ... best schema to a forum

2002-05-29 Thread José Moreira



-Mensagem original-
De: José Moreira [mailto:[EMAIL PROTECTED]]
Enviada: terça-feira, 28 de Maio de 2002 15:14
Para: [EMAIL PROTECTED]
Assunto: FW: hello ... best schema to a forum
Importância: Alta




im trying  to figure out the best mySQL schema to create a forum on my
website ... to result in a tree-view style presentation

what i have right now is a 3 table schema : categories  sub-categories 
lines ... wich would result in a code parsing to emulate the tree

the other way is a nodes-leaf schema that whould envolve recursive
programming ...

the result i wouuld want is something like, ex.


º main
º programming
º php

whats your opinion ?

my regards,

josé moreira
portugal



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




Re: [PHP-DB] Resource ID#2 ????

2002-05-29 Thread Jas

If you look at the previously posted code at the bottom of the form there is
a echo for the sql select statement that is echoing Resource id #2 on the
page.  Now that error is the correct field id number in the database, I am
just not sure how to itemize the data from that table, at least I think.
Any help would be great!
Jas

Jason Wong [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 On Thursday 30 May 2002 00:17, Jas wrote:
  Ok here is my problem, I set this up so a user selects a name form a
select
  box and that name or $user_id is then  passed to this page so the user
can
  edit the contact info etc.  However it does not pull the selected
$user_id
  and place each field into my form boxes, all I get is a Resource ID #2.
  Not sure how I can over come this...
 
  $table = auth_users;
   $record = @mysql_query(SELECT * FROM $table WHERE user_id =
  '$user_id',$dbh);

 Make liberal use of error checking (see manual) and mysql_error().

 --
 Jason Wong - Gremlins Associates - www.gremlins.com.hk
 Open Source Software Systems Integrators
 * Web Design  Hosting * Internet  Intranet Applications Development *


 /*
 grep me no patterns and I'll tell you no lines.
 */




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




RE: [PHP-DB] Resource ID#2 ????

2002-05-29 Thread Leotta, Natalie (NCI/IMS)

I could be missing something, but it looks like you are using the result of
the mysql_query as the actual result.  It actually returns some weird
identifier.  To access the real info you'd have to use something like
mysql_fetch_array to get it.

Check out this and see if it helps:

http://www.php.net/manual/en/function.mysql-query.php

-Natalie

-Original Message-
From: Jas [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, May 29, 2002 12:18 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Resource ID#2 


Ok here is my problem, I set this up so a user selects a name form a select
box and that name or $user_id is then  passed to this page so the user can
edit the contact info etc.  However it does not pull the selected $user_id
and place each field into my form boxes, all I get is a Resource ID #2.  Not
sure how I can over come this...

$table = auth_users;
 $record = @mysql_query(SELECT * FROM $table WHERE user_id =
'$user_id',$dbh);
$var_form .= table width=\100%\ border=\0\ cellpadding=\7\form
name=\$user_id\ method=\post\ action=\del_account.php\
  trtd width=\20%\ colspan=\2\bEdit Account
$user_id/b/td/tr
trtd width=\20%\First Name:/tdtd width=\80%\input
type=\text\ name=\$f_name\ size=\30\ maxlength=\30\
value=\$f_name\font class=\copyright\i.e. John/font/td/tr
trtd width=\20%\Last Name:/tdtd width=\80%\input
type=\text\ name=\$l_name\ size=\30\ maxlength=\30\
value=\$l_name\font class=\copyright\i.e. Doe/font/td/tr
  trtd width=\20%\Email:/tdtd width=\80%\input
type=\text\ name=\$email_addy\ size=\30\ maxlength=\30\
value=\$email_addy\font class=\copyright\i.e.
[EMAIL PROTECTED]/font/td/tr
trtd width=\20%\User Name:/tdtd width=\80%\input
type=\text\ name=\$un\ size=\30\ maxlength=\30\ value=\$un\font
class=\copyright\i.e. j-doe/font/td/tr
trtd width=\20%\Password:/tdtd width=\80%\input
type=\password\ name=\$pw\ size=\30\ maxlength=\30\font
class=\copyright\(password must be alpha-numeric, i.e.
pAs5w0rd)/font/td/tr
trtd width=\20%\Confirm Password:/tdtd
width=\80%\input type=\password\ name=\$pw\ size=\30\
maxlength=\30\font class=\copyright\please confirm password
entered/font/td/tr
trtd width=\20%\nbsp;/tdtd width=\80%\input
type=\submit\ name=\add\ value=\edit user\nbsp;nbsp;input
type=\reset\ name=\reset\ value=\reset\/td/tr
   /form/table;
echo $record;
} else {
blah blah
}
Thanks in advance,
Jas




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

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




[PHP-DB] Outlook Out Of Office

2002-05-29 Thread Ryan Jameson (USA)

i know this List isn't for this, but I'm about to go on vacation and I don't want to 
AutoReply everytime someone posts to this list. Does anyone know how I can set Out Of 
Office to skip sending a reply when the mail was sent to 
[EMAIL PROTECTED] ? I looked at the rules and all of the actions are the ones that 
I don't need. None of them are Don't send response ... I imagine this could be 
helpful for others as well.

 Ryan

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




Re: [PHP-DB] Resource ID#2 ????

2002-05-29 Thread Jason Wong

On Thursday 30 May 2002 00:41, Jas wrote:
 If you look at the previously posted code at the bottom of the form there
 is a echo for the sql select statement that is echoing Resource id #2 on
 the page.  Now that error is the correct field id number in the database, I
 am just not sure how to itemize the data from that table, at least I think.
 Any help would be great!

You are confused -- #2 just happens to coincide with your field id.

You're not RFTM.

mysql_query() returns a result_id (Resource id #2).

You feed this into a mysql_fetch_row() (or any of the other similar functions) 
to actually retrieve records.

-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
1: No code table for op: ++post
*/


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




RE: [PHP-DB] Outlook Out Of Office

2002-05-29 Thread Leotta, Natalie (NCI/IMS)

I couldn't find a way to exclude someone - even in the rules it didn't look
like it had anything like that.  It doesn't even look like you can skip it
if you delete.

You might want to try to the MS website - they have a pretty thorough FAQ
and it's much better than the help that comes up with the paperclip (I
didn't find it in there)!  If you find anything, please let me know.  I
don't want to spam everyone with my Out of Office replies either :-)

-Natalie

-Original Message-
From: Ryan Jameson (USA) [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, May 29, 2002 12:50 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Outlook Out Of Office


i know this List isn't for this, but I'm about to go on vacation and I don't
want to AutoReply everytime someone posts to this list. Does anyone know how
I can set Out Of Office to skip sending a reply when the mail was sent to 
[EMAIL PROTECTED] ? I looked at the rules and all of the actions are the
ones that I don't need. None of them are Don't send response ... I imagine
this could be helpful for others as well.

 Ryan

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

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




[PHP-DB] Remote Update ONCE a day

2002-05-29 Thread César L . Aracena

Hi all,

Two days ago I was requested to make a proyect for a non-profit company, and I'm doing 
the drwaings for the databases and programming which I will use. This company wants to 
run the program in a PC which will not hold the main DB (which will will at HQ), but 
they also not need the new information in real time.

What I don't know, if there's a way for me to install two programs and two DBs and had 
them updated let's say once a day using PC-ANYWARE or internet. I think maybe the one 
way to do this, is by making the HQ computer, download a file which holds the las 24 
hours changes to the working DB. Is it possible for me to make PHP update the working 
DB and also reflect those changes into a Text file?

I hope there's a better way that I haven't tink of yet. Does anyone knows this?

Thanx in advance,

Cesar Aracena
[EMAIL PROTECTED]
Neuquen, Argentina



Re: [PHP-DB] Resource ID#2 ????

2002-05-29 Thread Jas

How can I get the form below to list the single record in a db that matches
the request of $user_id?
$table = auth_users;
 $record = @mysql_query(SELECT * FROM $table WHERE user_id =
'$user_id',$dbh);
   while ($row = mysql_fetch_row($record)) {
$user_id = $row['user_id'];
$f_name = $row['f_name'];
$l_name = $row['l_name'];
$email_addy = $row['email_addy'];
$un = $row['un'];
$pw = $row['pw']; }
$var_form .= table width=\100%\ border=\0\ cellpadding=\7\form
name=\$user_id\ method=\post\ action=\del_account.php\
  trtd width=\20%\ colspan=\2\bEdit Account
$user_id/b/td/tr
trtd width=\20%\First Name:/tdtd width=\80%\input
type=\text\ name=\f_name\ size=\30\ maxlength=\30\
value=\$f_name\font class=\copyright\i.e. John/font/td/tr
trtd width=\20%\Last Name:/tdtd width=\80%\input
type=\text\ name=\l_name\ size=\30\ maxlength=\30\
value=\$l_name\font class=\copyright\i.e. Doe/font/td/tr
  trtd width=\20%\Email:/tdtd width=\80%\input
type=\text\ name=\email_addy\ size=\30\ maxlength=\30\
value=\$email_addy\font class=\copyright\i.e.
[EMAIL PROTECTED]/font/td/tr
trtd width=\20%\User Name:/tdtd width=\80%\input
type=\text\ name=\un\ size=\30\ maxlength=\30\ value=\$un\font
class=\copyright\i.e. j-doe/font/td/tr
trtd width=\20%\Password:/tdtd width=\80%\input
type=\password\ name=\pw\ size=\30\ maxlength=\30\font
class=\copyright\(password must be alpha-numeric, i.e.
pAs5w0rd)/font/td/tr
trtd width=\20%\Confirm Password:/tdtd
width=\80%\input type=\password\ name=\pw\ size=\30\
maxlength=\30\font class=\copyright\please confirm password
entered/font/td/tr
trtd width=\20%\nbsp;/tdtd width=\80%\input
type=\submit\ name=\add\ value=\edit user\nbsp;nbsp;input
type=\reset\ name=\reset\ value=\reset\/td/tr
   /form/table;
echo $record;
Thanks in advance,
Jas


Natalie Leotta [EMAIL PROTECTED] wrote in message
7546CB15C0A1D311BF0D0004AC4C4B0C024AC420@SSIMSEXCHNG">news:7546CB15C0A1D311BF0D0004AC4C4B0C024AC420@SSIMSEXCHNG...
 I could be missing something, but it looks like you are using the result
of
 the mysql_query as the actual result.  It actually returns some weird
 identifier.  To access the real info you'd have to use something like
 mysql_fetch_array to get it.

 Check out this and see if it helps:

 http://www.php.net/manual/en/function.mysql-query.php

 -Natalie

 -Original Message-
 From: Jas [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, May 29, 2002 12:18 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP-DB] Resource ID#2 


 Ok here is my problem, I set this up so a user selects a name form a
select
 box and that name or $user_id is then  passed to this page so the user can
 edit the contact info etc.  However it does not pull the selected $user_id
 and place each field into my form boxes, all I get is a Resource ID #2.
Not
 sure how I can over come this...

 $table = auth_users;
  $record = @mysql_query(SELECT * FROM $table WHERE user_id =
 '$user_id',$dbh);
 $var_form .= table width=\100%\ border=\0\
cellpadding=\7\form
 name=\$user_id\ method=\post\ action=\del_account.php\
   trtd width=\20%\ colspan=\2\bEdit Account
 $user_id/b/td/tr
 trtd width=\20%\First Name:/tdtd width=\80%\input
 type=\text\ name=\$f_name\ size=\30\ maxlength=\30\
 value=\$f_name\font class=\copyright\i.e. John/font/td/tr
 trtd width=\20%\Last Name:/tdtd width=\80%\input
 type=\text\ name=\$l_name\ size=\30\ maxlength=\30\
 value=\$l_name\font class=\copyright\i.e. Doe/font/td/tr
   trtd width=\20%\Email:/tdtd width=\80%\input
 type=\text\ name=\$email_addy\ size=\30\ maxlength=\30\
 value=\$email_addy\font class=\copyright\i.e.
 [EMAIL PROTECTED]/font/td/tr
 trtd width=\20%\User Name:/tdtd width=\80%\input
 type=\text\ name=\$un\ size=\30\ maxlength=\30\
value=\$un\font
 class=\copyright\i.e. j-doe/font/td/tr
 trtd width=\20%\Password:/tdtd width=\80%\input
 type=\password\ name=\$pw\ size=\30\ maxlength=\30\font
 class=\copyright\(password must be alpha-numeric, i.e.
 pAs5w0rd)/font/td/tr
 trtd width=\20%\Confirm Password:/tdtd
 width=\80%\input type=\password\ name=\$pw\ size=\30\
 maxlength=\30\font class=\copyright\please confirm password
 entered/font/td/tr
 trtd width=\20%\nbsp;/tdtd width=\80%\input
 type=\submit\ name=\add\ value=\edit user\nbsp;nbsp;input
 type=\reset\ name=\reset\ value=\reset\/td/tr
/form/table;
 echo $record;
 } else {
 blah blah
 }
 Thanks in advance,
 Jas




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



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




[PHP-DB] mssql_connect problem

2002-05-29 Thread Brian

I removed some 'security' settings that Microsoft had recommended which had
prevented Named Pipe connections to our Microsoft SQL server.  Basically
requiring everyone to use TCPIP connections.  Which is very simple when
using a sYstem DSN or ADODB or any number of ASP connection types.  But the
latest version of PHP 4.2.1 seems to have a bug in mssql.connect where it
DOES NOT use TCPIP connection, it for some reason always wants to use Named
Pipes, even when you use a FQDN,1433 which should force it to use TCPIP.  I
don't know why, and since PHP is free, there really isn't a single company
in charge of fixing such a problem.

Registry settings set back to:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\LSA]
RestrictAnonymous=dword:

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanManServer\Parameter
s]
RestrictNullSessAccess=dword:

The following Registry Settings on SQL 2000 server caused PHP 4.2.1
mssql.connect to fail a connection even though ASP pages and ODBC.connect
using a system DSN configured to use TCPIP had no problem

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\LSA]
RestrictAnonymous=dword:0002

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanManServer\Parameter
s]
RestrictNullSessAccess=dword:0001

Microsoft recommends these two settings for security purposes.  I do not
know why mssql_connect doesn't like those set on the SQL server.  In theory
putting ,1433 at the end of the servername should force mssql to use a tcpip
connection, but it doesn't when passed thru IIS 5.0.  If I ran the php
script in a dos prompt under an admin account from the IIS system, it had no
problem, but when under the IUSR account, it could not make the connection
and would error with the trust issue.





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




RE: [PHP-DB] dropping one word from column entries

2002-05-29 Thread Beau Lebens

A cleaner option might be to do this before you get it to PHP at all, via
your SQL query.

Check out the string functions available, there are a number of
substring-style things available, string position etc.

HTH

Beau

// -Original Message-
// From: Ed Gorski [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 30 May 2002 12:09 AM
// To: Jen Swofford; php-db@lists. php. net
// Subject: Re: [PHP-DB] dropping one word from column entries
// 
// 
// use:
// 
// $name=Mouse Housing Products;
// $name=str_replace(Products,,$name);
// 
// also the RTFM() function works too
// 
// ed
// 
// At 11:06 AM 5/29/2002 -0500, Jen Swofford wrote:
// I'm having a problem with this and suppose I'm looking for 
// a handout.  :|
// 
// I am displaying names of product categories.  The names of 
// the categories
// are:
// 
// Bird Cages
// Cat Toys
// Chinchilla Housing Products
// Dog Leashes
// Ferret Housing Products
// Mouse Housing Products
// 
// What I want to do when displaying the names is to drop 
// Products whenever
// it appears.  What I want do display on the page instead is:
// 
// Bird Cages
// Cat Toys
// Chinchilla Housing
// Dog Leashes
// Ferret Housing
// Mouse Housing
// 
// And no, changing the names of the categories in the 
// database is not an
// option.  :)  I'm completely missing the boat on this one... 
// any help?
// 
// Jen Swofford
// [EMAIL PROTECTED]
// 
// 
// 
// 
// --
// 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-DB] mysql exclusion in php

2002-05-29 Thread Chris Payne

Hi there everyone,

How can I do a search which excludes certain words if they put a - in the search 
string?  I can do a search easily, but if they put a - infront of a word in the 
string, how can I then get MySQL to search all entries EXCEPT where the word with a - 
next to it appears?

Thanks for everything.

Chris



RE: [PHP-DB] mysql exclusion in php

2002-05-29 Thread Beau Lebens

chris, you'll need to do a little PHP manipulation, perhaps (pseudo)

if -word. (regular expression?)
for each -word
SQL .=  NOT LIKE '%word% AND'
endforeach
endif
for each other word
SQL .=  LIKE '%word%' AND
endforeach

strip trailing AND

clean up SQL as required

query db

-
ok, obviously that's very rough, but i think something like that will work
:)

HTH

Beau




// -Original Message-
// From: Chris Payne [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 30 May 2002 12:22 PM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] mysql exclusion in php
// 
// 
// Hi there everyone,
// 
// How can I do a search which excludes certain words if they 
// put a - in the search string?  I can do a search easily, but 
// if they put a - infront of a word in the string, how can I 
// then get MySQL to search all entries EXCEPT where the word 
// with a - next to it appears?
// 
// Thanks for everything.
// 
// Chris
// 

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




[PHP-DB] Truncated Data

2002-05-29 Thread Larentium

Hello,

I desperately need help...  I've based my entire project on the use of input text 
boxes that can be read or edited.  Its a web form that gets its data from mysql 
tables.  For some reason when I write the code this way and use single quotes ('), 
everything after a single quote in the string gets truncated:

  echo input $ca name=university[$y] value='$university[$y]';

But when I use double quotes () like this:

  echo input $ca name=university[$y] value=\$university[$y]\;

Everything after a  gets truncated in the text string.  When I first input the data 
it goes into the mysql database fine.  The problem only lies in when I import the 
value into the html form.  I even tried writing the code like this:

  echo input $ca name=university[$y] value=$university[$y];

And here is what the source code shows:
  input class=Inputa name=university[1] value=John's Wayne

But the input box shows only:  John's

Oh, and I don't get the problem when I use textarea instead of input tags, but 
they just won't do for the design.
Any help or advise would be greatly appreciated.


Larentium
[EMAIL PROTECTED]


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




RE: [PHP-DB] Truncated Data

2002-05-29 Thread Beau Lebens

htmlspecialchars()

Beau

// -Original Message-
// From: Larentium [mailto:[EMAIL PROTECTED]]
// Sent: Thursday, 30 May 2002 10:40 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] Truncated Data
// 
// 
// Hello,
// 
// I desperately need help...  I've based my entire project on 
// the use of input text boxes that can be read or edited.  Its 
// a web form that gets its data from mysql tables.  For some 
// reason when I write the code this way and use single quotes 
// ('), everything after a single quote in the string gets truncated:
// 
//   echo input $ca name=university[$y] value='$university[$y]';
// 
// But when I use double quotes () like this:
// 
//   echo input $ca name=university[$y] value=\$university[$y]\;
// 
// Everything after a  gets truncated in the text string.  
// When I first input the data it goes into the mysql database 
// fine.  The problem only lies in when I import the value into 
// the html form.  I even tried writing the code like this:
// 
//   echo input $ca name=university[$y] value=$university[$y];
// 
// And here is what the source code shows:
//   input class=Inputa name=university[1] value=John's Wayne
// 
// But the input box shows only:  John's
// 
// Oh, and I don't get the problem when I use textarea 
// instead of input tags, but they just won't do for the design.
// Any help or advise would be greatly appreciated.
// 
// 
// Larentium
// [EMAIL PROTECTED]
// 
// 
// -- 
// 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