[PHP-DB] Re: function ??

2001-07-28 Thread CC Zona

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

> are INSERT INTO statements forbiden inside a function??

Assuming that you're referring to a PHP function and not a function of the 
RDBMS, no it's not forbidden.  Show the relevant snip of code and any error 
messages being reported.  Most likely, you've got a typo or syntactical 
problem that's causing the insert to fail (ex. forgetting to bring a global 
var into the function's local scope, an extra curly brace, missing quote, 
etc.).

-- 
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] Warning: Page has Expired

2001-07-28 Thread olinux o

How can I do away with this error when the BACK button
is pushed?

Thanks,
olinux

__
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.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] Retrieving Rows - Can I Change The Order?

2001-07-28 Thread Thomas Lamy

> Von: Caleb Walker [mailto:[EMAIL PROTECTED]]
> Gesendet: Samstag, 28. Juli 2001 08:26
> An: Dave Watkinson; PHP-MySQL List
> Betreff: Re: [PHP-DB] Retrieving Rows - Can I Change The Order?
> 
> 
> 
> > Now then, I have changed a column in the table, and the 
> only way I found to
> > change a data type is to delete the offending column and 
> then add it again.
> >
> > When I do the select now the new column, which was at 
> $row[3] is now always
> > $row[39]. I don't mind this, because I know where it is, 
> but is there any
> > way I can make it appear at $row[3] again? I'm sure you can 
> imagine when
> > there are quite a few pages using this code it's easier to 
> reorder the
> > columns in the select than to change all my if() codes!
> 
You should use mysql_fetch_array() instead of mysql_fetch_row(), so you can
refer to your columns by name, as in:
$q = mysql_query("select id,name from address;");
$a = mysql_fetch_array ($q);
==> now you can use $a['id'] and $a['name'] to get the field's values.

I found it always good practice to name all affected columns in a query, so
you have no pain  if your columns get mixed by db alters.


Thomas


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] Re: function ?? SOLVED

2001-07-28 Thread phpnet

SOLVED
Wrong varable!
Is that as bad as spelling errors?
Dave



| In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] 
| wrote:
| 
| > are INSERT INTO statements forbiden inside a function??
| 
| Assuming that you're referring to a PHP function and not a function of the 
| RDBMS, no it's not forbidden.  Show the relevant snip of code and any error 
| messages being reported.  Most likely, you've got a typo or syntactical 
| problem that's causing the insert to fail (ex. forgetting to bring a global 
| var into the function's local scope, an extra curly brace, missing quote, 
| etc.).
| 
| -- 
| 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]
| 
| 

[EMAIL PROTECTED]

SeaPortNetHosting: Reliable Web Hosting
Plans from $17.95 www.yourname.com
http://www.SeaPortNet.com/
1(209)551-7028 

-- 
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: Problems with update und delete's

2001-07-28 Thread Ulrich Liener

the id is my primary key - 

is the primary automatic indexed?

Uli

Jeffery Cann wrote:
> 
> It sounds like your 'id' column does not have an index.
> 
> Jeff
> 
> Uli wrote:
> 
> > Hallo!
> >
> > Maybe you can help me with my problems.
> >
> > I have a html form that deletes (or updates) over a php-script datas from
> > my database like "delete from table_name where id=xy"
> >
> > and it works correctly.
> >
> > But when I have about 100 entries in my database then it takes about 50
> > sec. to delete an entry.
> >
> > Do you know what it can be
> >
> > Please send replies to this newsgroup or to [EMAIL PROTECTED]
> >
> > Thanx a lot.
> >
> > Uli
> >
> >
> >

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

2001-07-28 Thread Sergey Larionov


"Warning: InterBase: arithmetic exception, numeric overflow, or string
 truncation  Cannot  transliterate character between character sets in
 /home/larionov/public_html/base.php on line 6"
How I can turn off tranliteration?

·•·•·•·
Sergey Larionov-[EMAIL PROTECTED], http://larionov.akl.ru


-- 
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] replace string - case insensitive

2001-07-28 Thread J- E- N

hello

str_replace is case sensitive, what function should i use for case insensitive.

thanks very much.



[PHP-DB] Re: Tree Display

2001-07-28 Thread Dennis

Hi,Maybe you can use Javascript to do it.Namely,you get your menu's content
from DB with PHP or others,and set its to Javascript 's array.

Try it!

Dennis




"Sharif Islam" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> I am still trying to figure out how to do it. I want to display my result
> from the data base in tree/menu like system.
>
> So the result page will look like this:
>
>
>   +Result1 (you click this , it will expand)
>   -Item1 (you click this and get more info)
>   -Item2
>   -Item3
>
>   +Result2
>   -Item1
>   -Item2
>
>
> All the records will be pulled from the same table.
>
> Any hint?
>
>
>



-- 
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] Seperate a variable

2001-07-28 Thread Sharmad Naik

Hi,
I m extracting a variable from a dbase and assigning it as say
$var .The Value of this variable is always a/or more number/s at the begining
followed by a set of characters .I want to seperate the numbers from
the characters.Can anybody explain me how to
say value of $var= 511Tha 
-- 
Donot rely on the Operating System which don't have any sources for.
-Seen somewhere on the Net
___  _  _  _
|_|_||_||_||\/||_|| \
_|| || || \|  || ||_/

-- 
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] Warning Page Expired

2001-07-28 Thread olinux o

How do I eliminate this error when the BACK button is
used?

Warning Page Expired

Thanks,
olinux


__
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.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] Record Update Link

2001-07-28 Thread Richard Chauvaux

There's a good tutorial that covers the subject of creating a list of 
contacts with hyperlinks to edit, delete etc. at:
http://hotwired.lycos.com/webmonkey/programming/php/tutorials/tutorial4.html

It was my first intro to PHP and was extremely helpful, although if I 
remember right a couple of the lines in his code were truncated by my 
browser. Still was able to use and fill in the blanks ok.

Steve Fitzgerald wrote:

> I seem to be having difficulty creating a hypertext link between the results
> of a sql query, ie a a formated page with a contact record (FirstName,
> LastName, etc.) to a page that will allow for editing. The results page is
> text only and the edit/update page has text boxes.
> 
> Not sure if this clear, but any help would be greatly appreciated.
> 
> 
> 


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DB] Re: Seperate a variable

2001-07-28 Thread Hugh Bothwell


"Sharmad Naik" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
> I m extracting a variable from a dbase and assigning it as say
> $var .The Value of this variable is always a/or more number/s at the
begining
> followed by a set of characters .I want to seperate the numbers from
> the characters.Can anybody explain me how to
> say value of $var= 511Tha

ereg("([0-9]*)([A-Za-z]*)", $var, $reg);

then $reg[1] = "511" and $reg[2] = "Tha";



-- 
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: Record Update Link

2001-07-28 Thread Al Savage

(posted & emailed)

> I seem to be having difficulty creating a hypertext link between the
> results of a sql query, ie a a formated page with a contact record
> (FirstName, LastName, etc.) to a page that will allow for editing.

I think that I'm doing what you're trying to do.  See my demo at:

http://pmaco.fdns.net/demo/contacts1.php

It's a demo page, so go ahead and edit records all you like.
While viewing any record, select the "Edit" button, and you'll be taken
to a page where the that record may be edited. 

> The results page is text only and the edit/update page has text
> boxes. 

Well, I think this is what I'm doing, if I understand you right.

> Not sure if this clear, but any help would be greatly appreciated. 

If the demo is similar to the result you'd like, let me know and I'll
show how it's done.

Regards,
Al S.

-- 
* Hillman & other Rootes Group manuals online: http://asavage.fdns.net/Hillman
* Ford Falcon manuals online:  http://FalconFAQ.fdns.net

OREGON - " The Great Pacific NorthWET"

cc: Steve Fitzgerald <[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] 2 Tables- 1 Insert Problem

2001-07-28 Thread Steve Fitzgerald

I'm trying to insert data into two separate tables using 1 INSERT. The code
below represents a first crack at it, but I can't seem to figure out how to
get this to work properly.

Thanks.

Steve






-- 
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] 'htaccess" method : how to modify passwords from PHP scripts ?

2001-07-28 Thread JD Daniels

That is where I got the class originally...

The url for the guys who wrote the class is here:

http://www.thewebmasters.net/

They have a link right on the front page.
There are actually two classes.. htgroup and htpasswd... I have put them
into one file for my own use.

Sorry to everyone for the confusion.

JD

-Original Message-
From: Caleb Walker [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 25, 2001 6:56 PM
To: JD Daniels; Samuel Torton
Cc: php
Subject: Re: [PHP-DB] 'htaccess" method : how to modify passwords from
PHP scripts ?


On Tuesday 24 July 2001 10:22 am, JD Daniels wrote:
> There is a fantastic class that takes care of writing .ht* files... look
> here:
>
> http://phpclasses.upperdesign.com/
>
Couldnt find anything on writing .ht* files.  Are you sure?


-- 
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] 2 Tables- 1 Insert Problem

2001-07-28 Thread olinux

Not possible.

do this $result_1 = mysql_query($sql1) or die('Insert 1 failed');
do this $result_2 = mysql_query($sql2) or die('Insert 2 failed');

olinux

-Original Message-
From: Steve Fitzgerald [mailto:[EMAIL PROTECTED]]

I'm trying to insert data into two separate tables using 1 INSERT. The code
below represents a first crack at it, but I can't seem to figure out how to
get this to work properly.

Thanks.

Steve

_
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] Checking radio buttons for multiple records/Updating multiple records...

2001-07-28 Thread olinux

Ok, here is what I am trying to do. I know that it is very common.

Simplified: I have a tabble of users with an AUTHORIZE field [type ENUM -
Yes or No]. They sign up and once I authorize them. I pull up all of the
records and display them something like this:

User Name -  Authorize: [] Yes [] No

So i run my select thru a while loop and end up with

User Name -  Authorize: [] Yes [] No
User2 Name -  Authorize: [] Yes [] No
User3 Name -  Authorize: [] Yes [] No
User4 Name -  Authorize: [] Yes [] No

The settings already in the database should show. So that either Yes or No
is checked for each user.

so here is the code I use:

if ($authorize == "Y") { $chk_authorize = "Authorized: Yes No"; } else { $chk_authorize = "Authorized:
Yes No"; }

This works EXCEPT only the last field displays a checked radio button
[because the names are all the same.

How can do this so that each record displays current authorization setting?

After this I need to be able to SUBMIT the info to UPDATE the table.

I understand that I will have to execute a number of update statements ...
But how can I create these statements that tie the correct username and
AUTHORIZE value together?

thanks much,
olinux


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