RE: [PHP-DB] Re: onnecting to MSSQL database from Linux?

2002-09-26 Thread Chris Grigor
I have got a copy of ctllib-linux-elf.tgz as it says on the php website, but I need another file called devlib.tgz. Anyone know where I can get a copy from??? Chris -Original Message- From: Avi Schwartz [mailto:[EMAIL PROTECTED]] Sent: 18 September 2002 02:44 To: [EMAIL PROTECTED]

[PHP-DB] using more that 2 conditions to obtain info from db

2002-09-26 Thread Earl Clare
hi everyone, I am new to all php and mySQL. What i am trying to do is to obtain information from the db using 3 conditions. this is what i've got $sql_num = mysql_query(SELECT * FROM siteinfo WHERE dive_operator = '1' AND status = '1',$db) or die (mysql_error()); the 3 conditions i need is

Re: [PHP-DB] Writing to files (db related) ish

2002-09-26 Thread Miguel Carvalho
Hi, Hi All I know how to open, read write to files using Php. But how can you write some content to a particular place in a file, Not the start or end but say the middle some where. Example: Basic html file html head title/title /head body Write my stuff here!!! /body /html

[PHP-DB] Caculating minutes since DATETIME column?

2002-09-26 Thread Leif K-Brooks
I need a way to calculate the number of minutes since the value of a DATETIME column in mysql. Any ideas? Thanks. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP-DB] Caculating minutes since DATETIME column?

2002-09-26 Thread John Holmes
SELECT UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(your_column) / 60 AS Minutes FROM your_table ---John Holmes... -Original Message- From: Leif K-Brooks [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 26, 2002 12:29 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Caculating minutes

[PHP-DB] Session understanding

2002-09-26 Thread Rodrigo
Hi people, if i use this code: ?php session_start(); if(empty($_SESSION['username'])) { die('An error has ocurred. It may be that you have not logged in, or that your session has expired. Please try a href=login.phplogging in/a again or

RE: [PHP-DB] Session understanding

2002-09-26 Thread Steve Bradwell
If you include the other page AFTER you do this check you'll be fine. So run your if statement and then add an else...include other.php; HTH, Steve. -Original Message- From: Rodrigo [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 26, 2002 9:38 AM To: PHP Subject: [PHP-DB] Session

Re: [PHP-DB] Caculating minutes since DATETIME column?

2002-09-26 Thread Leif K-Brooks
Thanks a lot for your help, but just a not to anuyone else who tries this. Since there's no ()s around UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(your_column) , it thinks that you're trying to get: UNIX_TIMESTAMP(NOW()) - (UNIX_TIMESTAMP(your_column) /60) Instead of: (UNIX_TIMESTAMP(NOW()) -

[PHP-DB] Re: Setting up a web server wit Redhat 7.3

2002-09-26 Thread Peter Goggin
I dont know if this is the right list. I have installed the php-mysql package and can now connect to the database. There is however error which I do not undertand. Warning: No MySQL-Link resource supplied in /usr/local/www/vantweststamps/databaselogin.php on line 15 Connected successfully ,Line

[PHP-DB] Current row of query

2002-09-26 Thread Patrick Lebon
Is there a mysql or array variable for the current row of a query array? I want to alternate background colours for each row of the query output so i need to know the current row number. Thanks -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit:

RE: [PHP-DB] Session understanding

2002-09-26 Thread Griffiths, Daniel
as long as that same session code is present at the top of all the included files that are put in later. basicaly you need to put the session code in every page (even if you only intend use it as an include) you wish to protect otherwise its contents can be read by directly typing in the url

Re: [PHP-DB] Current row of query

2002-09-26 Thread Brad Bonkoski
oops... I meant: (if $i is odd) ... because $i would be the current index in the array. Brad Bonkoski wrote: why not this? $result = mysql_query(Select * from table'); $num_rows = mysql_num_rows($rows); for ($i=0; $i$num_rows, $i++) { $row = mysql_fetch_array($result); if

Re: [PHP-DB] Current row of query

2002-09-26 Thread Adam Williams
why not if (!($1%2)) { echo even!; } else { echo odd!; } Adam On Thu, 26 Sep 2002, Brad Bonkoski wrote: oops... I meant: (if $i is odd) ... because $i would be the current index in the array. Brad Bonkoski wrote: why not this? $result = mysql_query(Select *

RE: [PHP-DB] Current row of query

2002-09-26 Thread Hutchins, Richard
Not sure here, but you might also run into a problem if you start your if statement with $i=0. If PHP does not treat the value 0 as even or odd, your first row is most likely going to be purple along with your second row. I know it's nitpicky, but I could see myself spending half an hour trying

Re: [PHP-DB] Current row of query

2002-09-26 Thread Patrick Lebon
Thanks, im currently doing something similar to this but I was wondering if there was an already defined variable that i could use rather then have to create a value and increment it myself. I guess am being picky, but was just curious as im new to php. This is how im currently doing it...

Re: [PHP-DB] Current row of query

2002-09-26 Thread Brad Bonkoski
then add an extra conditional to check if $i is equal to 0, or start $ off as 1so, for ($i=1, $i$num_rows+1; $i++) -or- if ($i==0) //treat as even either way woudl work. -Brad Hutchins, Richard wrote: Not sure here, but you might also run into a problem if you start your if statement with

Re: [PHP-DB] Current row of query

2002-09-26 Thread Brad Bonkoski
Last I checked there was no way to retrieve the current index into the result array, you can set the index manually with mysql_seek_data(), but I don't think that is what you want, so the best solution IMHO, is to do what you are doing and manually keep track of the index. -Brad Patrick Lebon

RE: [PHP-DB] Session understanding

2002-09-26 Thread Ford, Mike [LSS]
-Original Message- From: Griffiths, Daniel [mailto:[EMAIL PROTECTED]] Sent: 26 September 2002 16:09 as long as that same session code is present at the top of all the included files that are put in later. basicaly you need to put the session code in every page (even if you only

RE: [PHP-DB] Current row of query

2002-09-26 Thread Ford, Mike [LSS]
-Original Message- From: Patrick Lebon [mailto:[EMAIL PROTECTED]] Sent: 26 September 2002 16:20 This is how im currently doing it... $rowNum = 0; while ( $row = mysql_fetch_array($result) ) { $rowNum++; if ($rowNum % 2) { $bgCol = #EADBC6; } else { $bgCol = #EFE1CE; }

RE: [PHP-DB] Current row of query

2002-09-26 Thread John Holmes
You can use instead of %, and it may be quicker. $rowNum = 0; while ( $row = mysql_fetch_array($result) ) { $bgcolor = ($rowNum++ 1) ? #EADBC6 : #EFE1CE; ... ---John Holmes... -Original Message- From: Ford, Mike [LSS] [mailto:[EMAIL PROTECTED]] Sent: Thursday,

RE: [PHP-DB] Current row of query

2002-09-26 Thread John Holmes
Is there a mysql or array variable for the current row of a query array? I want to alternate background colours for each row of the query output so i need to know the current row number. There is a way with SQL variables, but you're better off just letting PHP keep track of it. ---John

[PHP-DB] Valid IP

2002-09-26 Thread Wilmar Perez
Hello guys I know this should be asked in another list but don't want to subcribe just for a simple question. I apologise in advance if that bothers anyone. I'm trying to check valid IPs that come from a form filled by a user so I'm using the following: function valid_ip($ip) { //Check

[PHP-DB] Need help urgent!!

2002-09-26 Thread Thomas \omega\ Henning
I'm using PHP4.2.2 Win with MySQL 3.2.52 Win and PHP doesn't pass vars from 1 php to the other how i fix it? Thanks -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP-DB] Need help urgent!!

2002-09-26 Thread Ryan Jameson (USA)
Do you mean passing vars between forms, between functions, or between includes? Ryan -Original Message- From: Thomas omega Henning [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 26, 2002 10:49 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] Need help urgent!! I'm using PHP4.2.2 Win

RE: [PHP-DB] Need help urgent!!

2002-09-26 Thread Hutchins, Richard
What's you register_globals set to? -Original Message- From: Thomas omega Henning [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 26, 2002 12:49 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Need help urgent!! I'm using PHP4.2.2 Win with MySQL 3.2.52 Win and PHP doesn't

Re: [PHP-DB] Need help urgent!!

2002-09-26 Thread Pierre-Alain Joye
On Thu, 26 Sep 2002 19:48:31 +0300 Thomas \omega\ Henning [EMAIL PROTECTED] wrote: I'm using PHP4.2.2 Win with MySQL 3.2.52 Win and PHP doesn't pass vars from 1 php to the other how i fix it? Read the documentation, register_globals is SET to off by default.

Re: [PHP-DB] Need help urgent!!

2002-09-26 Thread Dan Brunner
Check your register_globals value in your PHP.INI!! Dan On Thursday, September 26, 2002, at 11:48 AM, [EMAIL PROTECTED] wrote: I'm using PHP4.2.2 Win with MySQL 3.2.52 Win and PHP doesn't pass vars from 1 php to the other how i fix it? Thanks -- PHP Database Mailing List

RE: [PHP-DB] Valid IP

2002-09-26 Thread Ryan Jameson (USA)
Try this: function padIP($ip){ $ar = explode(.,$ip); $ip = ; $xt = ; for ($i = 0; $icount($ar); $i++){ $ip .= $xt.substr(($ar[$i]+1000),1); $xt = .; } return $ip; } -Original Message- From: Wilmar Perez [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 26,

RE: [PHP-DB] Valid IP

2002-09-26 Thread John Holmes
Take out those + in your regular expression and it works fine for me, for any format. ---John Holmes... -Original Message- From: Wilmar Perez [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 26, 2002 12:40 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Valid IP Hello guys I

RE: [PHP-DB] Valid IP

2002-09-26 Thread John Holmes
Shouldn't it be [0-9] for each of the elements, also? What if I want to put 123.012.123.123 or something similar? ---John Holmes... -Original Message- From: Wilmar Perez [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 26, 2002 12:40 PM To: [EMAIL PROTECTED] Subject: [PHP-DB]

Re: [PHP-DB] Valid IP

2002-09-26 Thread Pierre-Alain Joye
On Thu, 26 Sep 2002 11:39:40 -0500 Wilmar Perez [EMAIL PROTECTED] wrote: Hello guys I know this should be asked in another list but don't want to subcribe just for a simple question. I apologise in advance if that bothers anyone. I'm trying to check valid IPs that come from a form

[PHP-DB] MySQL Server Problem

2002-09-26 Thread Peter Rektorschek
Hi, I don't know if I'm right at this list. I have installed the mysql server on my debian Linux Server and it runs perfectly if I'm connecting it from my Puretec Webspace. But if I'm connecting from Apache with PHP4 running on localhost with the same script it won't run but no Error are logged

[PHP-DB] Re:[PHP-DB] php and javascript

2002-09-26 Thread Smita Manohar
heyyy i got the solution for this !!(after spending whole day...) in my code, javascript was not accepting the statement : document.subj_frm.chk_id[i].checked=true cos in php script i was using : input type=checkbox name=chk_id[] value=.$row[subj_id]. /td i changed the

[PHP-DB] binary data?

2002-09-26 Thread Chris Payne
Hi there everyone, How can I import binary data - say from a gif file, into a string or array in PHP? I can do text files/csv etc . but using the same method it won't do binary (I'm sure for some obvious reason). Thanks for your help Chris

RE: [PHP-DB] Valid IP

2002-09-26 Thread Wilmar Perez
You're right, thanks. Shouldn't it be [0-9] for each of the elements, also? *** Wilmar Pérez Network Administrator Library System Tel: ++57(4)2105145

[PHP-DB] Return Array from Function

2002-09-26 Thread Hutchins, Richard
Can somebody tell me what I might be doing wrong in the code below? I'm trying to use a function to perform an often-used db query and return the resulting resource to the calling script. I keep getting this error though: Parse error: parse error, unexpected T_LNUMBER, expecting T_VARIABLE or

RE: [PHP-DB] Return Array from Function

2002-09-26 Thread Hutchins, Richard
Sorry, line 51 is the one that reads: $1contentID=$row[1contentID]; -Original Message- From: Hutchins, Richard [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 26, 2002 4:19 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Return Array from Function Can somebody

Re: [PHP-DB] Return Array from Function

2002-09-26 Thread 1LT John W. Holmes
You can't start variables with a number. ---John Holmes... - Original Message - From: Hutchins, Richard [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, September 26, 2002 4:18 PM Subject: [PHP-DB] Return Array from Function Can somebody tell me what I might be doing wrong in

Re: [PHP-DB] Return Array from Function

2002-09-26 Thread Dave Smith
Try single-quotes instead of double (' instead of ). Could be an interpolation issue. --Dave On Thu, 26 Sep 2002, Hutchins, Richard wrote: Can somebody tell me what I might be doing wrong in the code below? I'm trying to use a function to perform an often-used db query and return the

RE: [PHP-DB] Return Array from Function - SOLVED

2002-09-26 Thread Hutchins, Richard
John Holmes pointed out to me that I had made a stupid error by starting my variable names with a number. Cardinal no-no. I know better. Really. That solved the parse error. Another error popped up after that stating that the variable $levelones was not a valid resource whenever I tried to

[PHP-DB] Update involving a list field

2002-09-26 Thread Shiloh Madsen
Hi, Im using a form that updates a database entry. In it one of my fields is a drop down/list field. Whenever the value in this field is changed, instead of updating it to the new item, it is deleted entirely. I have the same field in my entry page that inserts just fine, but for some reason

[PHP-DB] Categorized list?

2002-09-26 Thread Leif K-Brooks
I'm trying to create a system to store virtual objects. Each object will be in a category, and the categories may be in other categories. The categorie list might look something like: Food Candy Healthy Food Vegeterian food Organic food Gross food I'm thinking of

Re: [PHP-DB] Categorized list?

2002-09-26 Thread Mihail Bota
Leif, You may want to look over the system I am creating. It is for neurobiology, but it uses categories. The URL is http://brancusi.usc.edu/bkms I am using both trees and colors. Regarding your specific problem, you have to have an indexing table, which will make the necessary relations

Re: [PHP-DB] Current row of query

2002-09-26 Thread Patrick Lebon
Thanks for your help. As i said im quite new to php so all your help in simplifying my code has been appeciated. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DB] New Question...tables

2002-09-26 Thread Shiloh Madsen
Thanks to Micah Ive resolved my old problem, but now im working on something new and fairly gnarly...i ahve a data entry form and one of the textareas on the form needs to have the ability to take a table...from users who dont know html. does anyone know any possible solutions to this dilemma?

[PHP-DB] Re: [PHP] New Question...tables

2002-09-26 Thread Tom Rogers
Hi, Friday, September 27, 2002, 10:20:32 AM, you wrote: SM Thanks to Micah Ive resolved my old problem, but now im working on something new and fairly gnarly...i ahve a data entry form and one of the textareas on the form needs to have the ability to SM take a table...from users who dont know

[PHP-DB] query fails with mysql_query but success with direct SQL from command line

2002-09-26 Thread Thoenen, Peter Mr. EPS
Hello everybody, This command fails when ran with mysql_query but succeeds when ran command line. Have verified connection good... a simple mysql_query(SELECT * FROM {$user}_tickets); returns true. Any ideas? $query=mysql_query( SELECT *, UNIX_TIMESTAMP(date_submitted)

[PHP-DB] [PHP-MySQL] Locking record

2002-09-26 Thread ¥ì¹F¬F©v
I'm a newbie of PHP and MySQL. Would anyone tell me that how to lock and unlock a record of MySQL from PHP? And how other can detect whether this record is locked or not? Thanks for your help. Regards, Michael Wai -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP-DB] [PHP-MySQL] lock a record of MySQL from PHP

2002-09-26 Thread Michael Wai
I'm a newbie of PHP and MySQL. Would anyone tell me that how to lock and unlock a record of MySQL from PHP? And how other can detect whether this record is locked or not? Thanks for your help. Regards, Michael Wai -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit:

RE: [PHP-DB] query fails with mysql_query but success with direct SQL from command line

2002-09-26 Thread John W. Holmes
How do you know if fails? What does mysql_error() say? ---John Holmes... -Original Message- From: Thoenen, Peter Mr. EPS [mailto:[EMAIL PROTECTED]] Sent: Thursday, September 26, 2002 10:13 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] query fails with mysql_query but success with

[PHP-DB] o mica problema cu PHP

2002-09-26 Thread xde7ori
Salut, te-am vazut in lista PHP si m-am gandit ca poate m-ai putea ajuta intr-o problema. interoghez o baza de date si extrag anumite campuri pe care le asez intr-o pagina. Vreau ca in functie de valorile existente si selectate de catre user sa reinteroghez baza de date si in cadrul aceleasi