[PHP-DB] RE: General PHP problem

2001-08-30 Thread Ali Nayeri

Thanks for your reply. Yeah that was the problem. I guess it is a good
practice to use track_vars in case that globals are not on.

Thanks again

-Original Message-
From: CC Zona [mailto:[EMAIL PROTECTED]]
Sent: August 29, 2001 11:11 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Re: General PHP problem


In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Ali Nayeri) wrote:

> >> File php1.php
> print("Hi $name");
>
> >>File test.htm
>
> 
> Name:

Check phpinfo(): is the option "register_globals" turned on?  See
 for more info...

You may always want to do var_dump($HTTP_GET_VARS) and/or
var_dump(get_defined_vars()) from php1.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]


_
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] Re: SELECT giving too much :)

2001-08-30 Thread Steve Brett

SELECT distinct(students.fname), courses.title AS course FROM students,
courses,
> course_enrolments, groups, locations, staff WHERE
> (students.studentID=course_enrolments.studentID AND
> course_enrolments.courseID=courses.courseID) AND
> (students.groupID=groups.groupID) AND (staff.staffID=courses.staffID)
ORDER
> BY fname ASC

should do iy

Steve

"Beau Lebens" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi guys, I have a set-up to query a database by allowing the user to build
a
> query from selecting fields, restrictions etc etc.
>
> It produces the following;
>
> SELECT students.fname, courses.title AS course FROM students, courses,
> course_enrolments, groups, locations, staff WHERE
> (students.studentID=course_enrolments.studentID AND
> course_enrolments.courseID=courses.courseID) AND
> (students.groupID=groups.groupID) AND (staff.staffID=courses.staffID)
ORDER
> BY fname ASC
>
> which gets the right results, but it returns something like this;
>
> +---+--+
> | fname | course   |
> +---+--+
> | Beau  | Graduate Certificate in Learning Technologies (K-12) |
> | Beau  | Graduate Certificate in Learning Technologies (K-12) |
> | Grant | Short Course in Learning Technologies (K-12) |
> | Grant | Short Course in Learning Technologies (K-12) |
> +---+--+
>
> and it should only be returning one of each of those records any
> suggestions?
>
> thanks
>
> Beau
>
>
> --
> Beau F Lebens, Technical Officer
> National Key Centre for School Science and Mathematics
> Science and Mathematics Education Centre
> Curtin University of Technology,
> GPO Box U1987 Perth, Western Australia 6845
>
> t: +61 8 9266 7297 (has voice-mail)
> f: +61 8 9266-2503 (ATT: Beau Lebens)
> e: [EMAIL PROTECTED]
> w: http://learnt.smec.curtin.edu.au/



-- 
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] store an array in a mysqldb

2001-08-30 Thread Jeroen van Bussel

I would like to know if it is somehow possible to store an array in a mysql
DB.

Could somebody please help me.

greetz Jeroen



-- 
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] store an array in a mysqldb

2001-08-30 Thread Justin Buist

Nothing comes to mind that isn't a bit of a "hack" really.  You could try
seperating the data with delimiters before putting it in, then splitting
the data back up into an array at query time.

You could setup some tables, one called 'arrays' and one called
'array_values".

Arrays would pretty much be one column -- just the id.  Array_values would
be 4 columns (3 if order doesn't matter) with: array_value_id, array_id,
value, sequence (optional).

However, I should probably note last I knew PostgreSQL supports the
insertion of arrays into a record natively... though I have never
personally used it.

Justin Buist
Trident Technology, Inc.
4700 60th St. SW, Suite 102
Grand Rapids, MI  49512
Ph. 616.554.2700
Fx. 616.554.3331
Mo. 616.291.2612

On Thu, 30 Aug 2001, Jeroen van Bussel wrote:

> I would like to know if it is somehow possible to store an array in a mysql
> DB.
>
> Could somebody please help me.
>
> greetz Jeroen
>
>
>
> --
> 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-DB] RE: Could get all data from MYSQL using Mysql_fetch_array!!

2001-08-30 Thread Andrew Chase



> -Original Message-
> From: Andrew Chase [mailto:[EMAIL PROTECTED]]

> Or you could do it longhand -
>
> while ($row= mysql_fetch_array($result,MYSQL_ASSOC))
> {
>   print ("{$row["Reason"]}");
>   print ("{$row["OtherField1]}");
>   print ("{$row["OtherField2]}");
> }
>

Whoa!  Correction there - I forgot the end quotes after "OtherField1 and
"OtherField2

:P

-Andy


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




[PHP-DB] Seperate Tables for Same Data?

2001-08-30 Thread jv

Greetings,

I am setting up two seperate tables that will hold identically INSERTed
data. The reason for this is that one table will hold data that will expire
by timestamp daily and the other will hold the very same data for later
manipulation.

Is sending identical data like this to two seperate tables a good practise
or is there a better way?

Thanks,

James



-- 
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] Seperate Tables for Same Data?

2001-08-30 Thread Justin Buist

I'd suggest only inserting data into the "working" table throughout the
day, then on a nightly basis drop the index on the archived table, import
the data from the working table into the archived one, re-create the
index and clear out your working table.

As time goes on that archived table is going to get huge and you don't
want your DB trying to insert into something like that during production
hours.  Better off waiting for some downtime where you can batch the whole
thing in there.

Just my two cents.

Justin Buist
Trident Technology, Inc.
4700 60th St. SW, Suite 102
Grand Rapids, MI  49512
Ph. 616.554.2700
Fx. 616.554.3331
Mo. 616.291.2612

On Thu, 30 Aug 2001, jv wrote:

> Greetings,
>
> I am setting up two seperate tables that will hold identically INSERTed
> data. The reason for this is that one table will hold data that will expire
> by timestamp daily and the other will hold the very same data for later
> manipulation.
>
> Is sending identical data like this to two seperate tables a good practise
> or is there a better way?
>
> Thanks,
>
> James
>
>
>
> --
> 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] Date_Format Question

2001-08-30 Thread Jeff Oien

Thanks for the help Christopher and boclair. I think my problem was
putting single quotes around the field name within the parenthesis:
select date_format('creation_date', '%b %D, %Y') from Chart_Users;

This works:
select date_format(creation_date, '%M %D, %Y') from Chart_Users;
or
select date_format(creation_date, '%M %D, %Y') as creation from Chart_Users;
Jeff Oien

> Jeff,
> 
> mysql> select now();
> +-+
> | now()   |
> +-+
> | 2001-08-29 21:21:50 |
> +-+
> 1 row in set (0.00 sec)
> 
> mysql> SELECT DATE_FORMAT(NOW(), '%b %D, %Y') AS 'Formatted Current Time';
> ++
> | Formatted Current Time |
> ++
> | Aug 29th, 2001 |
> ++
> 1 row in set (0.00 sec)
> 
> mysql> SELECT DATE_FORMAT(NOW(), '%M %d, %Y') 'Formatted Current Time';
> ++
> | Formatted Current Time |
> ++
> | August 29, 2001|
> ++
> 1 row in set (0.00 sec)
> 
> OR. [this ex: assumes you have the connection string established]
> 
> $strSQL = "SELECT DATE_FORMAT(NOW(), '%M %d, %Y') 'Formatted Current Time'";
> $results = mysql_query($strSQL, $db) or die("Cannot execute $strSQL");
> 
> list($formattedDate) = mysql_fetch_array($results);
> 
> and you're done!
> 
> HTH,
> 
> Christopher Oson
> 
> -Original Message-
> From: Jeff Oien [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 29, 2001 8:29 PM
> To: PHP-DB
> Subject: RE: [PHP-DB] Date_Format Question
> 
> 
> Isn't that what I tried?
> Jeff Oien
> 
> > Although it might be better to format the date in php, don't forget you
> can
> > also do date formating in the select string.  The date format functions
> for
> > mySQL can me found here:
> >
> > http://www.mysql.com/doc/D/a/Date_and_time_functions.html
> >
> > Hope this helps,
> >
> >
> >
> > -Original Message-
> > From: Jeff Oien [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, August 29, 2001 8:07 PM
> > To: PHP-DB
> > Subject: [PHP-DB] Date_Format Question
> >
> >
> > I have a date like this in date format in MySQL
> > 2001-08-29
> >
> > and I want it to say
> > August 29, 2001
> >
> > I tried this and it didn't work.
> > select date_format('creation_date', '%b %D, %Y') from Chart_Users;
> >
> > Could you tell me what I'm doing wrong or how I should do this? Thanks.
> > Jeff Oien
> >
> > --
> > 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] Selection an id from a table where it doesn't exisit inanother

2001-08-30 Thread Sheridan Saint-Michel

- Original Message -
From: "Scott Mebberson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, August 29, 2001 8:16 PM
Subject: [PHP-DB] Selection an id from a table where it doesn't exisit in
another


> Hi Guys,
>
> I have two tables, words and searchwords. words contains a list of words
> with an id number next to them and searchwords contains a page id with a
> word id (from the words table). I want to select all of the id's from the
> words table which does not exist in the word_id feild in the searchwords
> table.
>
> Make sense, it is for searching? Let me know if it doesn't.
>
> This is the SQL query I am running on MySQL (3.22) - SELECT id FROM words,
> searchwords WHERE words.id != searchwords.word_id;

Try this instead

select words.id from words LEFT JOIN searchwords ON words.id = searchword
s.word_id where searchwords.word_id is NULL;

> It isn't working. All it does it return a list of results which are
totally
> incorrect.
>
> Thanks
>
> Scott.

Sheridan Saint-Michel
Website Administrator
FoxJet, an ITW Company
www.foxjet.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] DBM DATABASE PROBLEM!

2001-08-30 Thread andy

HELP!

I'm trying to use a DBM database as a book i bought discribes. I have copied the 
example but to no avail. The oly coclusion i ca come to is that i need somethig extra 
installed, or need to use a specific include. At the moment when i try to use it i get 
the following error;

"Fatal error: Call to undefined function: dbmopen() in path/to/my/script.php on line 
48"

HELP!
Andy.



[PHP-DB] Space in database coloumn

2001-08-30 Thread Nagasea

I had a database like this

Name : John Doe
Sex  : Male

when i want to call this data with url link

http://www.test.com/template.php?nick=John

why the (space)Doe is not in there.

what I suppose to do with the space
so it will looks like
http://www.test.com/template.php?nick=John%20Doe



_
www.kaskus.com - FREE EMAIL SERVICE

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

2001-08-30 Thread Jancs

At 10:30 PM 8/30/2001 +, you wrote:
>Hi! This is the ezmlm program. I'm managing the
>[EMAIL PROTECTED] mailing list.
>
>I'm working for my owner, who can be reached
>at [EMAIL PROTECTED]
>
>Acknowledgment: I have added the address
>
>[EMAIL PROTECTED]
>
>to the php-db mailing list.
>
>Welcome to [EMAIL PROTECTED]!
>
>Please save this message so that you know the address you are
>subscribed under, in case you later want to unsubscribe or change your
>subscription address.
>
>
>--- Administrative commands for the php-db list ---
>
>I can handle administrative requests automatically. Please
>do not send them to the list address! Instead, send
>your message to the correct command address:
>
>For help and a description of available commands, send a message to:
><[EMAIL PROTECTED]>
>
>To subscribe to the list, send a message to:
><[EMAIL PROTECTED]>
>
>To remove your address from the list, just send a message to
>the address in the ``List-Unsubscribe'' header of any list
>message. If you haven't changed addresses since subscribing,
>you can also send a message to:
><[EMAIL PROTECTED]>
>
>or for the digest to:
><[EMAIL PROTECTED]>
>
>For addition or removal of addresses, I'll send a confirmation
>message to that address. When you receive it, simply reply to it
>to complete the transaction.
>
>If you need to get in touch with the human owner of this list,
>please send a message to:
>
> <[EMAIL PROTECTED]>
>
>Please include a FORWARDED list message with ALL HEADERS intact
>to make it easier to help you.
>
>--- Enclosed is a copy of the request I received.
>
>Return-Path: <[EMAIL PROTECTED]>
>Received: (qmail 31660 invoked from network); 30 Aug 2001 22:30:40 -
>Received: from unknown (HELO mephisto.ktf.rtu.lv) (213.175.91.1)
>   by pb1.pair.com with SMTP; 30 Aug 2001 22:30:40 -
>Received: from zikurats.ktf.rtu.lv (dial57.as52.bkc.lv [195.244.129.121])
> by mephisto.ktf.rtu.lv (8.11.2/8.11.2) with ESMTP id f7ULSLE02688
> for 
> <[EMAIL PROTECTED]>; 
>   Fri, 31 Aug 2001 00:28:23 +0300
>Message-Id: <[EMAIL PROTECTED]>
>X-Sender: [EMAIL PROTECTED]
>X-Mailer: QUALCOMM Windows Eudora Version 5.1
>Date: Fri, 31 Aug 2001 00:28:27 +0300
>To: [EMAIL PROTECTED]
>From: Jancs <[EMAIL PROTECTED]>
>Subject: Re: confirm subscribe to [EMAIL PROTECTED]
>In-Reply-To: <[EMAIL PROTECTED]>
>Mime-Version: 1.0
>Content-Type: text/plain; charset="us-ascii"; format=flowed


-- 
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] PHP+Postgresql/Win32

2001-08-30 Thread Jancs

Hi there!
I am trying to use such combination of software: Apache 
1.3.20/PHP4.06/Postgres 7.1.3/Win2K. I met a serious problem -  some 
postgres database admin script (php)  says "Unable to connect to server".

I think i did everything i could - apache is running without problems, php 
is configured to use pgsql.dll. Anyway - something is wrong with php, it 
seems. I am making such decision because i am getting such error message in 
both cases - when postgres is running (with running cyg-ipc service) on not.

What makes it more difficult - i m trying to start it on the machine having 
no NIC and therefore using IP 127.0.0.1.

Everything other works well. Netstat says that postgres is listening on 
127.0.0.1:5432 More, i can use the pgadmin tool by GreatBridge (designed 
for nt/w2k, but using ODBC).



Jancs
Laps Cileecish

http://jancs.ktf.rtu.lv



-- 
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] Simple database error (SPACE)

2001-08-30 Thread Nagasea

//-- Anybody can help me with this problem (I think
//-- it's simple but im to stupid to know the answer)

==
while ($myrow = mysql_fetch_row($result)) {
echo("
$myrow[3] ."");
}
==

If I have a database in $myrow[3] and it has "space", it didn't work.

Example Database :  John Doe
__

it will shown 
 m_template?nick=John

I NEED PHP to show the space and Doe also
so it's suppose to be :

 m_template?nick=John Doe



_
www.kaskus.com - FREE EMAIL SERVICE

-- 
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] Simple database error (SPACE)

2001-08-30 Thread Dave Watkinson

try urlencode in the PHP manual ... I believe that'll do the trick!

Cheers

Dave


-Original Message-
From: Nagasea [mailto:[EMAIL PROTECTED]]
Sent: 30 August 2001 23:02
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Simple database error (SPACE)


//-- Anybody can help me with this problem (I think
//-- it's simple but im to stupid to know the answer)

==
while ($myrow = mysql_fetch_row($result)) {
echo("
$myrow[3] ."");
}
==

If I have a database in $myrow[3] and it has "space", it didn't work.

Example Database :  John Doe
__

it will shown 
 m_template?nick=John

I NEED PHP to show the space and Doe also
so it's suppose to be :

 m_template?nick=John Doe



_
www.kaskus.com - FREE EMAIL SERVICE

-- 
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] Simple database error (SPACE)

2001-08-30 Thread Brunner, Daniel

Hello!!!


Use mysql_fetch_object...


$myrow->WHATEVER


Whatever = whatever the field name is



Dan









> --
> From: Nagasea
> Reply To: [EMAIL PROTECTED]
> Sent: Thursday, August 30, 2001 5:01 PM
> To:   [EMAIL PROTECTED]
> Subject:  [PHP-DB] Simple database error (SPACE)
> 
> //-- Anybody can help me with this problem (I think
> //-- it's simple but im to stupid to know the answer)
> 
> ==
> while ($myrow = mysql_fetch_row($result)) {
> echo("
> $myrow[3] ."");
> }
> ==
> 
> If I have a database in $myrow[3] and it has "space", it didn't work.
> 
> Example Database :  John Doe
> __
> 
> it will shown 
>  m_template?nick=John
> 
> I NEED PHP to show the space and Doe also
> so it's suppose to be :
> 
>  m_template?nick=John Doe
> 
> 
> 
> _
> www.kaskus.com - FREE EMAIL SERVICE
> 
> -- 
> 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] Tablename issue..

2001-08-30 Thread Ryan Marrs

What about using a view?
(Not entirely sure if Oracle supports them, but I don't see why not)

Ryan

-Original Message-
From: Tom Wallace [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, August 29, 2001 5:13 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Tablename issue..


 Tried this - same errors --  Also tried the following permutations
(courtesy of Trevor Lanyon) --

You can try to encapsulate the table name with hard bracket
[Table - Name]

You can escape the character with a slash (I don't think this will work):

Table\ \- Name

You can escape the characters with the hexidecimal url encoding (I know this

only to work with one try of database, and I think the client is actually

stripping it off)

Table%20%2D%20Name



The ODBC source I'm trying to connect to is a Remedy (Action Request System)
4.5 system running on top of a Oracle 8 database.

Thanks - Tom

"Ryan Marrs" <[EMAIL PROTECTED]> wrote in message
EA9290E62E6CD311859200805F85164902FB13DE@EXCHANGE">news:EA9290E62E6CD311859200805F85164902FB13DE@EXCHANGE...
> Try putting Brackets [] around the spaces.  This will typically fix the
> problem, ie:
>
> $sql2 = odbc_exec($conn,"SELECT [Character Field] FROM [ABC - Table]");
>
> Let me know if it works!
>
> Ryan
>
> -Original Message-
> From: Tom Wallace [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 29, 2001 3:06 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] Tablename issue..
>
> Hola,
>
>   I'm having a difficult time figuring out the syntax here -- my table
name
> has spaces & dashes in it..Unfortunately I can't permanently change the
> tablename.. I've tried a half dozen different ways to access the table,
each
> return an error similar to this:
>
> Warning: SQL error: [ISAM]No data found, SQL state S00 in SQLExecDirect in
> c:\inetpub\wwwroot\test8.php on line 14
>
> but removing the spaces from the tablename and updating the php fixes it..
>
>  any ideas?
>
> $sql2 = odbc_exec($conn,"SELECT Character_Field FROM ABC - Table");
>
> Thanks,
> -Tom
>
>
>
>
> --
> 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]




[PHP-DB] Error inserting CLOB

2001-08-30 Thread Tom Tsongas

Hi folks.

I am getting a bizarre error when trying to insert CLOB data into my
Oracle 9i database. (Using PHP4 on Apache 1.3.20) Error refers to a
missing 'comma'?! Here is the exact error:

Warning: OCIStmtExecute: ORA-00917: missing comma in
/www/htdocs/Etrack/oracle_operations.php on line 52
Couldn't execute statement.

Here is the code:

// Set Clob variable
$clob = OCINewDescriptor($connection, OCI_D_LOB);

$sql = "INSERT INTO INCIDENT (incident, project,
 abstract, owner, reporter, state, priority, severity,
type,
 open, supportinc, product,
 version, build, component, comments)
 VALUES (INCIDENT_SEQ.NEXTVAL, '$project',
 '$textfieldabstract', '$owner', '$reporter', '$state',
'$priority', '$severity',
 '$type', TO_DATE(SYSDATE, '/MM/DD HH24:MI:SS'),
 '$supportinc', '$product',
 '$version', '$build', '$component',comments =
empty_clob()) returning comments into :commentstemp";

// parse SQL statement
$clob = OCINewDescriptor($connection, OCI_D_LOB);
$sql_statement = OCIParse($connection,$sql) or die("Couldn't parse
statement.");
OCIBindByName ($sql_statement, ":commentstemp", &$clob, -1, OCI_B_CLOB);

// execute SQL query
OCIExecute($sql_statement,OCI_DEFAULT) or die("Couldn't execute
statement.");
$clob->save($comments);
// Commit Statement
$result = OCICommit($connection);

The SQL statement works fine when I remove the CLOB portion so I know
the rest is correct.

HELP
Tom Tsongas





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

2001-08-30 Thread Malcolm White

I am having a problem with UPDATE queries with MySQL. Insert, Delete, etc
work fine. I have checked the query statement and it works fine directly
with MySQL just not in a PHP script. An example function is;

function update_gname($gid, $new_name){
  $query = "UPDATE Groups SET GName=$new_name WHERE GID=$gid";
  $result = mysql_query($query)
  or die("error: update_gname()");
  return $result;
}

I am using MySQL version 3.22.32 and PHP4.0.3pl1 as a module in Apache1.3.14
with Linux2..2.13.

Thanks,

Malcolm


-- 
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] Simple database error (SPACE)

2001-08-30 Thread Nagasea

it's still not working :(

maybe u need my script to see

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

mysql_select_db("mydatabase_com",$db);
$result = mysql_query("SELECT * FROM big_member WHERE position='Squads' ORDER by first 
LIMIT 0,300",$db);

while ($myrow = mysql_fetch_row($result)) {
echo("
. $myrow[3] ."");

}

I need to make $myrow give the result exactly from the database (including the space)

--- "Brunner, Daniel" <[EMAIL PROTECTED]>
> wrote:
>Hello!!!
>
>
>Use mysql_fetch_object...
>
>
>$myrow->WHATEVER
>
>
>Whatever = whatever the field name is
>
>
>
>Dan
>
>
>
>
>
>
>
>
>
>> --
>> From:Nagasea
>> Reply To:[EMAIL PROTECTED]
>> Sent:Thursday, August 30, 2001 5:01 PM
>> To:  [EMAIL PROTECTED]
>> Subject: [PHP-DB] Simple database error (SPACE)
>> 
>> //-- Anybody can help me with this problem (I think
>> //-- it's simple but im to stupid to know the answer)
>> 
>> ==
>> while ($myrow = mysql_fetch_row($result)) {
>> echo("
>> $myrow[3] ."");
>> }
>> ==
>> 
>> If I have a database in $myrow[3] and it has "space", it didn't work.
>> 
>> Example Database :  John Doe
>> __
>> 
>> it will shown 
>>  m_template?nick=John
>> 
>> I NEED PHP to show the space and Doe also
>> so it's suppose to be :
>> 
>>  m_template?nick=John Doe
>> 
>> 
>> 
>> _
>> www.kaskus.com - FREE EMAIL SERVICE
>> 
>> -- 
>> 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]
>> 
>>

_
www.kaskus.com - FREE EMAIL SERVICE

-- 
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] Simple database error (SPACE)

2001-08-30 Thread Nagasea

it's still not working :(

maybe u need my script to see

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

mysql_select_db("mydatabase_com",$db);
$result = mysql_query("SELECT * FROM big_member WHERE position='Squads' ORDER by first 
LIMIT 0,300",$db);

while ($myrow = mysql_fetch_row($result)) {
echo("
. $myrow[3] ."");

}

I need to make $myrow give the result exactly from the database (including the space)

--- "Brunner, Daniel" <[EMAIL PROTECTED]>
> wrote:
>Hello!!!
>
>
>Use mysql_fetch_object...
>
>
>$myrow->WHATEVER
>
>
>Whatever = whatever the field name is
>
>
>
>Dan
>
>
>
>
>
>
>
>
>
>> --
>> From:Nagasea
>> Reply To:[EMAIL PROTECTED]
>> Sent:Thursday, August 30, 2001 5:01 PM
>> To:  [EMAIL PROTECTED]
>> Subject: [PHP-DB] Simple database error (SPACE)
>> 
>> //-- Anybody can help me with this problem (I think
>> //-- it's simple but im to stupid to know the answer)
>> 
>> ==
>> while ($myrow = mysql_fetch_row($result)) {
>> echo("
>> $myrow[3] ."");
>> }
>> ==
>> 
>> If I have a database in $myrow[3] and it has "space", it didn't work.
>> 
>> Example Database :  John Doe
>> __
>> 
>> it will shown 
>>  m_template?nick=John
>> 
>> I NEED PHP to show the space and Doe also
>> so it's suppose to be :
>> 
>>  m_template?nick=John Doe
>> 
>> 
>> 
>> _
>> www.kaskus.com - FREE EMAIL SERVICE
>> 
>> -- 
>> 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]
>> 
>>

_
www.kaskus.com - FREE EMAIL SERVICE

-- 
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] Simple database error (SPACE)

2001-08-30 Thread Nagasea

it's still not working :(

maybe u need my script to see

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

mysql_select_db("mydatabase_com",$db);
$result = mysql_query("SELECT * FROM big_member WHERE position='Squads' ORDER by first 
LIMIT 0,300",$db);

while ($myrow = mysql_fetch_row($result)) {
echo("
. $myrow[3] ."");

}

I need to make $myrow give the result exactly from the database (including the space)

--- "Brunner, Daniel" <[EMAIL PROTECTED]>
> wrote:
>Hello!!!
>
>
>Use mysql_fetch_object...
>
>
>$myrow->WHATEVER
>
>
>Whatever = whatever the field name is
>
>
>
>Dan
>
>
>
>
>
>
>
>
>
>> --
>> From:Nagasea
>> Reply To:[EMAIL PROTECTED]
>> Sent:Thursday, August 30, 2001 5:01 PM
>> To:  [EMAIL PROTECTED]
>> Subject: [PHP-DB] Simple database error (SPACE)
>> 
>> //-- Anybody can help me with this problem (I think
>> //-- it's simple but im to stupid to know the answer)
>> 
>> ==
>> while ($myrow = mysql_fetch_row($result)) {
>> echo("
>> $myrow[3] ."");
>> }
>> ==
>> 
>> If I have a database in $myrow[3] and it has "space", it didn't work.
>> 
>> Example Database :  John Doe
>> __
>> 
>> it will shown 
>>  m_template?nick=John
>> 
>> I NEED PHP to show the space and Doe also
>> so it's suppose to be :
>> 
>>  m_template?nick=John Doe
>> 
>> 
>> 
>> _
>> www.kaskus.com - FREE EMAIL SERVICE
>> 
>> -- 
>> 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]
>> 
>>

_
www.kaskus.com - FREE EMAIL SERVICE

-- 
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] Simple database error (SPACE)

2001-08-30 Thread Dave Watkinson

OK, try this


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

mysql_select_db("mydatabase_com",$db);
$result = mysql_query("SELECT * FROM big_member WHERE position='Squads'
ORDER by first LIMIT 0,300",$db);

while ($myrow = mysql_fetch_row($result)) {
$link_string = urlencode($myrow[3]);
echo "$myrow[3]";
}

and you shouldn't really be doing a SELECT * - just name the columns you
really need :-)




-Original Message-
From: Nagasea [mailto:[EMAIL PROTECTED]]
Sent: 31 August 2001 01:01
To: Brunner, Daniel; '[EMAIL PROTECTED]'
Cc: PHP List (E-mail)
Subject: RE: [PHP-DB] Simple database error (SPACE)


it's still not working :(

maybe u need my script to see

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

mysql_select_db("mydatabase_com",$db);
$result = mysql_query("SELECT * FROM big_member WHERE position='Squads'
ORDER by first LIMIT 0,300",$db);

while ($myrow = mysql_fetch_row($result)) {
echo("
. $myrow[3] ."");

}

I need to make $myrow give the result exactly from the database
(including the space)

--- "Brunner, Daniel" <[EMAIL PROTECTED]>
> wrote:
>Hello!!!
>
>
>Use mysql_fetch_object...
>
>
>$myrow->WHATEVER
>
>
>Whatever = whatever the field name is
>
>
>
>Dan
>
>
>
>
>
>
>
>
>
>> --
>> From:Nagasea
>> Reply To:[EMAIL PROTECTED]
>> Sent:Thursday, August 30, 2001 5:01 PM
>> To:  [EMAIL PROTECTED]
>> Subject: [PHP-DB] Simple database error (SPACE)
>> 
>> //-- Anybody can help me with this problem (I think
>> //-- it's simple but im to stupid to know the answer)
>> 
>> ==
>> while ($myrow = mysql_fetch_row($result)) {
>> echo("
>> $myrow[3] ."");
>> }
>> ==
>> 
>> If I have a database in $myrow[3] and it has "space", it didn't work.
>> 
>> Example Database :  John Doe
>> __
>> 
>> it will shown 
>>  m_template?nick=John
>> 
>> I NEED PHP to show the space and Doe also
>> so it's suppose to be :
>> 
>>  m_template?nick=John Doe
>> 
>> 
>> 
>> _
>> www.kaskus.com - FREE EMAIL SERVICE
>> 
>> -- 
>> 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]
>> 
>>

_
www.kaskus.com - FREE EMAIL SERVICE

-- 
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] Simple database error (SPACE)

2001-08-30 Thread Doug Semig

DW was correct, Nagasea.  The way to do what you want to do is to use the
urlencode (and perhaps the urldecode) PHP command(s).  They are in the PHP
manual.  I don't understand what it was that DB told you to do, so I cannot
comment on that, but the correct solution to your problem lies with urlencode.

Additionally, you will want to put quotes around the HREF in your anchor
tag.  Perhaps if you rewrote your echo to something like this
(WARNING:untested!):

echo "";
echo $myrow[3];
echo "";

Oh, yeah, and I broke it apart for easy reading.  You could concatenate it
all in one big echo, but think maintainability.

Hope this helps,
Doug

At 05:01 PM 8/30/01 -0700, Nagasea wrote:
>it's still not working :(
>
>maybe u need my script to see
>
>$db = mysql_connect("localhost", "","pass");
>
>mysql_select_db("mydatabase_com",$db);
>$result = mysql_query("SELECT * FROM big_member WHERE position='Squads'
ORDER by first LIMIT 0,300",$db);
>
>while ($myrow = mysql_fetch_row($result)) {
>echo("
>. $myrow[3] ."");
>
>}
>
  [--snip--]

--Doug's Signature File
~ ~ ~ I'm proud to work for GLISnet,  Michigan's best ISP ~ ~ ~
--1.888.445.4763---8am to 8pm every day---http://www.glis.net--
The views and opinions expressed in this email are my
own and may not be those of my employer.


-- 
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] Simple database error [DONE!!-Thanks]

2001-08-30 Thread Nagasea

oo okay it's working right now !
thank you so much !

--- "Dave Watkinson" <[EMAIL PROTECTED]>
> wrote:
>OK, try this
>
>
>$db =3D mysql_connect("localhost", "","pass");
>
>mysql_select_db("mydatabase_com",$db);
>$result =3D mysql_query("SELECT * FROM big_member WHERE position=3D'Squads'
>ORDER by first LIMIT 0,300",$db);
>
>while ($myrow =3D mysql_fetch_row($result)) {
>   $link_string =3D urlencode($myrow[3]);
>   echo "href=3D\"m_template.php?nick=3D$link_string\">$myrow[3]";
>}
>
>and you shouldn't really be doing a SELECT * - just name the columns you
>really need :-)
>
>
>
>
>-Original Message-
>From: Nagasea [mailto:[EMAIL PROTECTED]]
>Sent: 31 August 2001 01:01
>To: Brunner, Daniel; '[EMAIL PROTECTED]'
>Cc: PHP List (E-mail)
>Subject: RE: [PHP-DB] Simple database error (SPACE)
>
>
>it's still not working :(
>
>maybe u need my script to see
>
>$db =3D mysql_connect("localhost", "","pass");
>
>mysql_select_db("mydatabase_com",$db);
>$result =3D mysql_query("SELECT * FROM big_member WHERE position=3D'Squads'
>ORDER by first LIMIT 0,300",$db);
>
>while ($myrow =3D mysql_fetch_row($result)) {
>echo("
>. $myrow[3] ."");
>
>}
>
>I need to make $myrow give the result exactly from the database
>(including the space)
>
>--- "Brunner, Daniel" <[EMAIL PROTECTED]>
>> wrote:
>>Hello!!!
>>
>>
>>Use mysql_fetch_object...
>>
>>
>>$myrow->WHATEVER
>>
>>
>>Whatever =3D whatever the field name is
>>
>>
>>
>>Dan
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>> --
>>> From:   Nagasea
>>> Reply To:   [EMAIL PROTECTED]
>>> Sent:   Thursday, August 30, 2001 5:01 PM
>>> To: [EMAIL PROTECTED]
>>> Subject:[PHP-DB] Simple database error (SPACE)
>>>=20
>>> //-- Anybody can help me with this problem (I think
>>> //-- it's simple but im to stupid to know the answer)
>>>=20
>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
>=3D
>>> while ($myrow =3D mysql_fetch_row($result)) {
>>> echo("
>>> $myrow[3] ."");
>>> }
>>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
>=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
>=3D
>>>=20
>>> If I have a database in $myrow[3] and it has "space", it didn't work.
>>>=20
>>> Example Database :  John Doe
>>> __
>>>=20
>>> it will shown=20
>>>  m_template?nick=3DJohn
>>>=20
>>> I NEED PHP to show the space and Doe also
>>> so it's suppose to be :
>>>=20
>>>  m_template?nick=3DJohn Doe
>>>=20
>>>=20
>>>=20
>>> _
>>> www.kaskus.com - FREE EMAIL SERVICE
>>>=20
>>> --=20
>>> 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]
>>>=20
>>>
>
>_
>www.kaskus.com - FREE EMAIL SERVICE
>
>--=20
>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]

_
www.kaskus.com - FREE EMAIL SERVICE

-- 
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] Previous | Next (Again)

2001-08-30 Thread Jeff Oien

I'm having a hard time figuring this out. I have a photo album that displays
one image at a time. I want to have Previous and Next links for images in
a users album. This was suggested:
http://www.phpbuilder.com/columns/rod2221.php3
but it seems to be more for a number of results instead of one.

At first I used the id field which is auto_increment and did -1 for
previous +1 for next but then realized if they delete an image in
the album the id field is no longer successive by 1. I can count
the number of images in an album but not sure how to know which
is the first, which is the second etc. and know which the current
one is if the id field has gaps in it. Not sure if that made any sense.
Jeff Oien

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

2001-08-30 Thread Paul Burney

on 8/30/01 4:06 PM, Malcolm White at [EMAIL PROTECTED] wrote:

> $query = "UPDATE Groups SET GName=$new_name WHERE GID=$gid";

If the Gname field is a string type, there should probably be quotes around
it.

$query = 'UPDATE Groups SET GName="' . $new_name . '" WHERE GID=' . $gid;

HTH.

Sincerely,

Paul Burney

++
Paul Burney
Webmaster && Open Source Developer
UCLA -> GSE&IS -> ETU
(310) 825-8365
<[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+Postgresql/Win32

2001-08-30 Thread Beau Lebens

i have never tried this myself, but i think you might have to load the
postgres module in php separately

there is a line like

;extension=php_pgsql.dll

or something in you php.ini file, remove the ; (comment) to enable it, and
restart apache

HTH

beau


// -Original Message-
// From: Jancs [mailto:[EMAIL PROTECTED]]
// Sent: Friday, 31 August 2001 5:47 AM
// To: [EMAIL PROTECTED]
// Subject: [PHP-DB] PHP+Postgresql/Win32
// 
// 
// Hi there!
// I am trying to use such combination of software: Apache 
// 1.3.20/PHP4.06/Postgres 7.1.3/Win2K. I met a serious problem -  some 
// postgres database admin script (php)  says "Unable to 
// connect to server".
// 
// I think i did everything i could - apache is running without 
// problems, php 
// is configured to use pgsql.dll. Anyway - something is wrong 
// with php, it 
// seems. I am making such decision because i am getting such 
// error message in 
// both cases - when postgres is running (with running cyg-ipc 
// service) on not.
// 
// What makes it more difficult - i m trying to start it on the 
// machine having 
// no NIC and therefore using IP 127.0.0.1.
// 
// Everything other works well. Netstat says that postgres is 
// listening on 
// 127.0.0.1:5432 More, i can use the pgadmin tool by 
// GreatBridge (designed 
// for nt/w2k, but using ODBC).
// 
// 
// 
// Jancs
// Laps Cileecish
// 
// http://jancs.ktf.rtu.lv
// 
// 
// 
// -- 
// 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-DB] Re: Previous | Next (Again)

2001-08-30 Thread Shin

Hi!

Don't use the ID to count prev or next image. Use the $offset variable
instead.

$result=mysql_query("select id,name,phone ".
"from TABLE where YOUR CONDITIONAL HERE ".
"order by ID asc limit $offset,$limit");

Regards

--

Shin

"Jeff Oien" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I'm having a hard time figuring this out. I have a photo album that
displays
> one image at a time. I want to have Previous and Next links for images in
> a users album. This was suggested:
> http://www.phpbuilder.com/columns/rod2221.php3
> but it seems to be more for a number of results instead of one.
>
> At first I used the id field which is auto_increment and did -1 for
> previous +1 for next but then realized if they delete an image in
> the album the id field is no longer successive by 1. I can count
> the number of images in an album but not sure how to know which
> is the first, which is the second etc. and know which the current
> one is if the id field has gaps in it. Not sure if that made any sense.
> Jeff Oien


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

2001-08-30 Thread Robert Vukovic

Table was created with this

CREATE TABLE `descriptions` (
  `id_property` bigint(20) NOT NULL default '0',
  `short_desc` varchar(255) default NULL,
  `long_desc` text,
  KEY `id_property`(`id_property`),
  PRIMARY KEY (`id_property`),
  UNIQUE KEY `id_property_2`(`id_property`)
) TYPE=MyISAM COMMENT='';

and this is query:

$res1=mysql_query("SELECT
$tbl_virtual.thumb1,$tbl_descriptions.short_desc FROM
$tbl_virtual,$tbl_descriptions WHERE $tbl_virtual.id_property=$link and
$tbl_descriptions.id_property=$link")

virtual is another table with picture names.

This query work at my home but not on real site. What is a problem. ?


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

2001-08-30 Thread Robert Vukovic

> Table was created with this
> 
> CREATE TABLE `descriptions` (
>   `id_property` bigint(20) NOT NULL default '0',
>   `short_desc` varchar(255) default NULL,
>   `long_desc` text,
>   KEY `id_property`(`id_property`),
>   PRIMARY KEY (`id_property`),
>   UNIQUE KEY `id_property_2`(`id_property`)
> ) TYPE=MyISAM COMMENT='';
> 
> and this is query:
> 
> $res1=mysql_query("SELECT 
> $tbl_virtual.thumb1,$tbl_descriptions.short_desc FROM 
> $tbl_virtual,$tbl_descriptions WHERE 
> $tbl_virtual.id_property=$link and
> $tbl_descriptions.id_property=$link")
> 
> virtual is another table with picture names.
> 
> This query work at my home but not on real site. What is a problem. ?
> 

I forgot to say that PHP is 4.04 and I am using MySQL


-- 
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+Postgresql/Win32-correction

2001-08-30 Thread Jancs

Hi there!
I am trying to use such combination of software: Apache 
1.3.20/PHP4.06/Postgres 7.1.3/Win2K. I met a serious problem -  some 
postgres database admin script (php)  says "Unable to connect to server 
using user=user, password=password, etc".

May be php script tries to autheticate the user with the win2k user 
database not the postgres?


-- 
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] Seperate Tables for Same Data?

2001-08-30 Thread Walter, Marcel

Which database do you use ?

I donĀ“t know mySql ... but I know Sybase very well and there you have
something called Triggers ...

[Cite SybaseDoc]
A trigger is a stored procedure that goes into effect when you insert,
delete, or update data in a table
[/CITE]

You could say for example
Create trigger for blahblah on insert 
as
begin
   take the inserted recordset and put it in another table ...
end

Cheers,
Marcel

> -Original Message-
> From: jv [SMTP:[EMAIL PROTECTED]]
> Sent: Thursday, August 30, 2001 17:44
> To:   [EMAIL PROTECTED]
> Subject:  [PHP-DB] Seperate Tables for Same Data?
> 
> Greetings,
> 
> I am setting up two seperate tables that will hold identically INSERTed
> data. The reason for this is that one table will hold data that will
> expire
> by timestamp daily and the other will hold the very same data for later
> manipulation.
> 
> Is sending identical data like this to two seperate tables a good practise
> or is there a better way?
> 
> Thanks,
> 
> James
> 
> 
> 
> -- 
> 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-DB] Re: Database "Transactions" and HTTP statelessness

2001-08-30 Thread John Lim

There is no need to use transactions if you are dealing with 1 table.

Have a version column in the table which is numeric. When you first
select/edit the record, store the version number.

When you update, use:

update table set version = version + 1, data = ...  where key=$id and
version = $version

If the version number is different (eg. someone has updated the record)
affected_rows() will be zero.

This technique is sometimes called an optimistic locking strategy.

Regards, John


"Bopolissimus Platypus" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> hello all,
>
> I've got a question about what's got to be a common problem.
> I'm sort of doing a survey to see how others have solved this
> problem before so that I can choose one that's best for me.
>
> Basics:
> The software is a web based data entry system.
> Sessions are maintained (so that users don't have to
>  login after every database operation, and for
>  security - users can only perform actions that
>  are allowed to their login or group0.
>
> Use Case:
> 0.   User A loads Record R.
> 1.   User B loads the same Record R.
> 2.   User B edits and saves Record R.
> 3.   User A edits and saves Record R.
>
> at this point, User B's changes are probably lost either
> in whole or in part.
>
> I can think of at least two or three ways to deal with this, but
> the two are ugly hacks that I'd rather avoid and the third risks
> running out of a vital and limited resource.
>
> The simplest solution I can think of would have the backend
> system start a transaction for A, at step 0.  the transaction
> would end at step 3.  User B would also try to start a
> transaction but since User A's transaction is still running,
> B would block until A ends it or rolls it back (since A is holding
> a lock).  for databases that don't have transactions, we would
> use record locking.
>
> The problem with this, of course, is that step 0 and step 3
> don't occur during the same HTTP request, so the transaction
> (or the locks) would have to be held/remembered between
> requests.  Further, the user need not actually save the record.
> he might just be viewing it.  After he's done, he might just
> close the browser.  So there would have to be a timeout
> so that locks would expire after a while.
>
> using SQL transactions as outlined above is messy but
> doable (there would be a middle-tier application layer that
> the PHP calls instead of calling database access functions
> directly).  i don't like it though because transactions are
> one per connection.  each possible database update
> would require a separate socket connection to the
> database.  and if our timeout is liberal (e.g., 30 minutes),
> then we're going to run out of sockets very quickly.
>
> i'd be very interested in hearing what others have
> done about this.  i've got other ideas that don't involve
> transactions, but i'm not going into those since they're
> too ugly to mention.  if i get desperate enough though,
> i may just ignore the ugliness and implement something
> just to get something working.
>
> tiger



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