Re: [PHP-DB] SELECT where something exists but something else does not

2002-02-21 Thread George Lioumis
Hi! I think I have solved your problem... I have attached an sql file to create the sample DB I created for my test and a PHP file for you to run to see how I have implemented it. First create the tables with the .sql file an then execute the .php file from your browser. Hope these help.

Re: [PHP-DB] SELECT where something exists but something else does not

2002-02-21 Thread George Lioumis
I think I forgot something usefull... - Original Message - From: Beau Lebens [EMAIL PROTECTED] To: PHP DB (E-mail) [EMAIL PROTECTED] Sent: Thursday, February 21, 2002 3:59 AM Subject: [PHP-DB] SELECT where something exists but something else does not Hey guys, I am a little stuck

[PHP-DB] Help on PHP vs JAVA

2002-02-21 Thread Berlina
Hello to everybody, I need some help for writting a comparison of PHP vs JAVA, and of course, I need that PHP wins ;-D Any ideas? Any comparison wrote? Advanced Thanks, F.P. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DB] Re: [PHP-DEV] Help on PHP vs JAVA

2002-02-21 Thread Lars Torben Wilson
On Thu, 2002-02-21 at 01:07, Berlina wrote: Hello to everybody, I need some help for writting a comparison of PHP vs JAVA, and of course, I need that PHP wins ;-D Wins what? For what task? This is quite a nebulous question. And if you've decided which will win before you've done the

Re: [PHP-DB] Double Dipping

2002-02-21 Thread DL Neil
Howdy John, Sorry for the lack of information in the subject line, but I didn't know how else to explain it briefly... =don't be sorry, re-word it! I have 2 tables and they look like this: There are 2 other tables involved, but they don't come into play for this portion of the problem so

[PHP-DB] How do I add multiple var to a if clause ?

2002-02-21 Thread Dave Carrera
Hi All If($var == 1,2,3){ } This is wrong so what is the right way. I am try to find out a if var equals either 1 2 or 3 do something type thing but cant find answers anywhere Thanks in Advance Dave Carrera Php / MySql Development Web Design Site Marketing http://www.davecarrera.com --

RE: [PHP-DB] How do I add multiple var to a if clause ?

2002-02-21 Thread matt stewart
either if (($var = 3)($var = 1)){ } if you want it to just be somewhere between one and 3, or $my_array = array (1, 2, 3); if (in_array($variable, $my_array)) { } if you want it to be just one of those exact values. -Original Message- From: Dave Carrera [mailto:[EMAIL

Re: [PHP-DB] How do I add multiple var to a if clause ?

2002-02-21 Thread George Lioumis
You can use: if ( ($var == 1) or ($var == 2) or ($var == 3)) { ... } - Original Message - From: Dave Carrera [EMAIL PROTECTED] To: php List [EMAIL PROTECTED] Sent: Thursday, February 21, 2002 12:40 PM Subject: [PHP-DB] How do I add multiple var to a if clause ? Hi All

[PHP-DB] Parse error (a bit OT)

2002-02-21 Thread Markus Lervik
Hello, Can anyone tell me what's wrong with line 68? I get a parse error on line 68 trying to run this. The strange thing is that it doesn't complain about line 54. Either I'm blind, stupid, or there's somehing very wrong here. I've checked above line 67 too, but there doesn't seem to be any

[PHP-DB] Re: Parse error (a bit OT)

2002-02-21 Thread Lerp
Hi there :) I think you just might be missing two curly braces. Like below. if ($prev_week) { while(date(W,mktime(0,0,0,$m,$d,$Y))==$week) { ...blababla... } } if ($next_week) { while(date(W,mktime(0,0,0,$m,$d,$Y))==$week) { ...blablabla... } } Hope this helps, Joe :) Markus Lervik [EMAIL

Re: [PHP-DB] Re: Parse error (a bit OT)

2002-02-21 Thread Markus Lervik
On Thu, 2002-02-21 at 14:36, Lerp wrote: Hi there :) I think you just might be missing two curly braces. Like below. if ($next_week) { while(date(W,mktime(0,0,0,$m,$d,$Y))==$week) { ...blablabla... } } Well, I intentionally left a few lines and curly brackets and stuff off the mail, so

[PHP-DB] newbe: how to import a whole db from an .sql file

2002-02-21 Thread steven
I'm moving a mySQL db from my own server over to an external hosting company. there I don't have any root access of course... so I log in the mySQL-console. I made a 'db-dump' of my mySQL db (with Webmin), so I've got a textfile with a large amount of SQL-statements inside. (CREATE TABLE and

Re: [PHP-DB] Re: Parse error (a bit OT)

2002-02-21 Thread Lerp
Glad you figured it out :) Cheers, Joe :) Markus Lervik [EMAIL PROTECTED] wrote in message 1014295168.26036.27.camel@hal9000">news:1014295168.26036.27.camel@hal9000... On Thu, 2002-02-21 at 14:36, Lerp wrote: Hi there :) I think you just might be missing two curly braces. Like below. if

Re: [PHP-DB] newbe: how to import a whole db from an .sql file

2002-02-21 Thread Billy S Halsey
Hi Steven, The problem is that when doing mysql_query (et al) from PHP, you DON'T specify the semicolon (;) at the end of a query. If you want to import this back into MySQL, do the following: 1. Go into mysql and recreate the database manually -- the dump from mysqldump does NOT have a

Re: [PHP-DB] Join

2002-02-21 Thread Jennifer Downey
Thank you Beau, Appreciate that clarification. Jen Beau Lebens [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... what you are referring to actually has nothing to do with PHP Jen - that's why the manual wasn't much help :) JOIN is an SQL command, so check out

[PHP-DB] Parse error

2002-02-21 Thread Jennifer Downey
Can someone tell me why I am getting a parse error in this little snip? ? $origVar = 100; echo POriginal value is $origVar/p; $origVar += 25; echo PAdded a value, now it's $origVar/p; $origVar -= 12; echo PSubtracted a value, now it's $origVar/p; $origVar .= chickens; echo PFinal answer:

RE: [PHP-DB] How do I add multiple var to a if clause ?

2002-02-21 Thread Hunter, Ray
If you are looking for speed and efficiency in your code then Mat has touched on it. This example will execute the fastest... If( $var = 3 ) {} If you do or statements or and statements all of the if statement needs to be evaluated. So if you have an or or and all the statements in the if

RE: [PHP-DB] Parse error

2002-02-21 Thread Cami
try: ? $origVar = 100; echo POriginal value is.$origVar./p; $origVar += 25; echo PAdded a value, now it's .$origVar./p; $origVar -= 12; echo PSubtracted a value, now it's .$origVar./p; $origVar .= chickens; echo PFinal answer: .$origVar./p; ? Cami -Original Message- From: Jennifer

[PHP-DB] Problems connecting to MySQL from a vhost

2002-02-21 Thread Gerard Earley
I'm developing php from a win2k box and recently added vhosts to the httpd.conf file, as shown below #+ NameVirtualHost * VirtualHost * ServerAdmin webmaster@localhost DocumentRoot D:/Internet/crestar/web/ ServerName

RE: [PHP-DB] Parse error

2002-02-21 Thread Gurhan Ozen
Hi Jenn, The code looked ok to me , so I copied and pasted the code you posted and it worked for me.. Where are you getting the parsing error? Is it the whole code anyway? Gurhan -Original Message- From: Jennifer Downey [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 21, 2002 9:33

Re: [PHP-DB] selecting question

2002-02-21 Thread ACEAlex
Ahha, thats true :) Clever :) - Original Message - From: William Fong [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 21, 2002 1:31 AM Subject: Re: [PHP-DB] selecting question That's what I'm talking about. Make that one table and put a 'status' column. Because

[PHP-DB] Re: Parse error

2002-02-21 Thread Jennifer Downey
You know this was a real bad stupid on my part. I saved the file in the wrong place. After moving the file to my web folder and not saving to the web folder I was using the original parse error file in the temp dir. I re-saved in the web folder and what do ya know it worked. Sorry for wasting

RE: [PHP-DB] Help on PHP vs JAVA

2002-02-21 Thread Gurhan Ozen
That's a pretty naive question to ask. For what specific task do you want to compare them ? Besides if you can't write a comparison article on PHP vs. JAVa , how can you set the outcome in PHP's favor? I would advise you to sit down and try to do the task both in Java and PHP , and compare both

[PHP-DB] Re: mysql_insert_id?

2002-02-21 Thread Christian Novak
Wee Chua [EMAIL PROTECTED] schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi, Is it possible that I would get the wrong ID (Not the ID I just inserted in Auto_Increment field) by using mysql_insert_id function if someone is also inserting record at the same time? How does

[PHP-DB] PHP ODBC

2002-02-21 Thread Paulo Freitas
Hi, I'm running True64 UNIX with ingres 6.4 and openlink ODBC. When i connect thru cgi(C/C++) it works fine but when i connect via PHP 4.1.1 gives me this error: [OpenLink][ODBC][Driver]No key columns found for table referenced by keyset driven cursor., SQL state IM909 in SQLPrepare I

[PHP-DB] configuring php for oracle...

2002-02-21 Thread Romeo Manzur
Can anybody tell me how could I configuring php for work with oracle 8...I read that the dll requieres otrher libraries but dont know wichs Greetings... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Double Dipping

2002-02-21 Thread John Hawkins
Ah Ha! I got it. This was a clear case of RTFM... Based on what you said, I went back and re-read page 67 of MySQL by Paul DuBouis and sure enough, it made sense this time... Here is what I came up with: SELECT gamedate, gametime, divisions.name as division, t1.name as teama, t2.name as teamb

[PHP-DB] Re: Help on PHP vs JAVA

2002-02-21 Thread John Lim
Hi Any consultant will tell you that all you need to do is define the comparison criteria and you can choose the winner easily. PHP: ease of use, low cost of ownership, etc. Java: scalability, choice of implementations, etc. I just hope you can live with your choices! Regards, John Berlina

[PHP-DB] Parse Error

2002-02-21 Thread jas
I hate to post this again but I have looked in a couple of php and mysql books but cannot seem to figure this one out. I am getting a parse error when trying to use php to delete records from a table. The error I am recieving is as follows Parse error: parse error in

RE: [PHP-DB] [OpenLink][ODBC][Driver]No key columns found for table referenced by keyset driven cursor

2002-02-21 Thread Andrew Hill
Paulo, This error is caused because odbc_connect is setting a dynamic cursor by default. This is usually not a problem, but a cursor needs a primary key. If no primary key exists on your table or if you are selecting against a view there will be a problem. I suggest you try adding a primary

Re: [PHP-DB] Parse Error

2002-02-21 Thread biorn
Is $cars an array field? If not, you are trying to compare $cars to an list/array of values (I am not sure this would work even if $cars was an array field) 'WHERE $cars = $car_type\,\$car_model\,\$car_year\,\$car_price\,\$car_vin\,\$dlr _num\);'. Normally, you would have to compare each

Re: [PHP-DB] formating problem

2002-02-21 Thread Andrés Felipe Hernández
jas, Replace echo input type=\submit\ name=\delete\ value=\delete\/form/table; With: echo trtdinput type=\submit\ name=\delete\ value=\delete\/td/tr/form/table; - Original Message - From: jas [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, February 19, 2002 3:12 AM Subject:

[PHP-DB] RE: Special Insertion Into MySQL - at a loss!

2002-02-21 Thread SpyProductions Support Team
The following code is how you should retrieve the data from mySQL... if you wanted to update all of the information through one button, though, I would do it in a slightly different way... ?php $sql = SELECT whatever FROM whatever...; $result = mysql_query($sql); while ($row =

Re: [PHP-DB] Parse Error

2002-02-21 Thread jas
Here is the code from the file that queries the db and pulls the current contents of the db and provides a check box form for each record to delete the items in the db. I dont know if this will help but like I said before any insight would be great. Thanks in advance. Jas ?php require

RE: [PHP-DB] Parse Error

2002-02-21 Thread Gurhan Ozen
Not enough information given to figure out what's going on, but looking at your query i see: WHERE $cars = $car_type\,\$car_model\,\$car_year\,\$car_price\,\$car_vin\,\$dlr _num\); do you keep 6 different values separated by commas in the field referenced by $cars??? If this is correct what

RE: [PHP-DB] Parse Error

2002-02-21 Thread Gurhan Ozen
Jas.. First of all you don't have the variable $cars assigned.. Second of all, we still don't know what the test table looks like? Does it only have one column with all the infos about cars populated in it??? Gurhan -Original Message- From: jas [mailto:[EMAIL PROTECTED]] Sent:

Re: [PHP-DB] Parse Error

2002-02-21 Thread jas
Here is the dump for the cars table... test ( id varchar(30) NOT NULL auto_increment, car_type varchar(30), car_model varchar(30), car_year varchar(15), car_price varchar(15), car_vin varchar(25), dlr_num varchar(25), PRIMARY KEY (id), KEY id (id) test VALUES ('1',

[PHP-DB] mysql connect, while and close big problem

2002-02-21 Thread Killer Angel Clark
I make a connection A to get an array of result. Then use a while loop to use the array. In the while loop, I use the data to select other data by making a new connection. After printing the data, I close this new connection. After the while loop, I close the first connection too. If only have

RE: [PHP-DB] mysql connect, while and close big problem

2002-02-21 Thread Hunter, Ray
What type of connections are you making persistent or non-persistent? Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From: Killer Angel Clark [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 21, 2002 10:17 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] mysql

[PHP-DB] illegal operation when accessing a php file!

2002-02-21 Thread Alvin Ang
Hi there, I am doing a school project on inventory management system, running very short on time. :( I just completed a php file for authenticating users accessing my site, but encountered illegal operation when trying to access the file. please help!!! ?php //Starting Session

RE: [PHP-DB] Parse Error

2002-02-21 Thread Gurhan Ozen
Ok then it sure will not work.. because you have : DELETE FROM $table_name WHERE $cars =\$car_type\,\$car_model\,\$car_year\,\$car_price\,\$car_vin\,\$d lr_num\); 1- $cars is set to the value checkbox which doesn't exist in your test table 2- The end of the statement $dlr_num\); is not

Re: [PHP-DB] Parse Error

2002-02-21 Thread jas
Could you maybe give me an example of how to associate the checkbox with the id? Thanks again, Jas Gurhan Ozen [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Ok then it sure will not work.. because you have : DELETE FROM $table_name WHERE $cars

Re: [PHP-DB] Parse Error

2002-02-21 Thread biorn
According to your code, if the checkbox next to the word 'remove' is checked, then the value of $cars passed to the form is checkbox. Then in the done2.php3 page, you are trying to delete where checkbox='array of values listed'. Is there a field in your database called checkbox? If so,

[PHP-DB] Secure Encrypt/Decrypt Functions

2002-02-21 Thread Jonathan Hilgeman
Does anyone know of a fairly simple, but secure technique for encrypting and decrypting text? - Jonathan -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP-DB] Secure Encrypt/Decrypt Functions

2002-02-21 Thread Hunter, Ray
You can use the mcrypt functions of php. You can look in the php manual here: http://www.php.net/manual/en/ref.mcrypt.php . You will also need to compile php with mcrypt. I use mcrypt with no problems. Ray Hunter Firmware Engineer ENTERASYS NETWORKS -Original Message- From:

[PHP-DB] debugging?

2002-02-21 Thread jas
Can someone tell me how I can find out why I am getting errors executing queries when I try to delete items from a table? I have 2 files... file 1. - Queries database, displays results with option to delete record using a check box, code is as follows... ?php require '../scripts/db.php'; $result

[PHP-DB] Errors Deleting...

2002-02-21 Thread jas
Can someone tell me how I can find out why I am getting errors executing queries when I try to delete items from a table? I have 2 files... file 1. - Queries database, displays results with option to delete record using a check box, code is as follows... ?php require '../scripts/db.php'; $result

RE: [PHP-DB] Errors Deleting...

2002-02-21 Thread Gurhan Ozen
Jas, You still have cars as your checkbox name.. change it to id.. and make sure that you assign $table_name to the table name you want to delete from in your done2.php3 file.. Gurhan -Original Message- From: jas [mailto:[EMAIL PROTECTED]] Sent: Thursday, February 21, 2002 3:28 AM To:

Re: [PHP-DB] debugging?

2002-02-21 Thread olinux
jas, Try this: - Remove the @, it suppresses the error - change die(Could not execute query, please try again later); to die(mysql_error()); $sql = mysql_query(DELETE FROM $table_name WHERE $id = 'id',$dbh) or die(mysql_error()); olinux --- jas [EMAIL PROTECTED] wrote: Can someone tell me

Re: [PHP-DB] Errors Deleting...

2002-02-21 Thread jas
I wish I could get this to work... it has not been able to work at all. I made the changes you have suggested and tried different variations concerning the results items and so far no dice. Here is my delete sql statement as of right now... ?php require '../scripts/db.php'; $table_name =

Re: [PHP-DB] debugging?

2002-02-21 Thread jas
Ok now that I can see the error message how can I fix it... the syntax looks correct and the error I am recieving is as follows You have an error in your SQL syntax near '= 'id'' at line 1 And this is my statement, $sql = mysql_query(DELETE FROM $table_name WHERE $id = 'id',$dbh) or

Re: [PHP-DB] debugging?

2002-02-21 Thread biorn
Here is what your delete statement should look like: $sql = mysql_query(DELETE FROM $table_name WHERE id = '$id',$dbh) or die(mysql_error()); Note the field name without the $ in front of it and the variable you are comparing it to with the $. One other note, in your table, you have id as a

Re: [PHP-DB] debugging?

2002-02-21 Thread jas
Ok now that the sql statement is working I am getting an error on my result function... here is the result function $result = mysql_query($sql, $dbh) or die(mysql_error()); and here is the error I am recieving You have an error in your SQL syntax near '1, 1' at line 1 I dont know enough about php

Re: [PHP-DB] debugging?

2002-02-21 Thread DL Neil
Ok jas Ok now that I can see the error message how can I fix it... the syntax looks correct and the error I am recieving is as follows You have an error in your SQL syntax near '= 'id'' at line 1 And this is my statement, $sql = mysql_query(DELETE FROM $table_name WHERE $id =

Re: [PHP-DB] debugging?

2002-02-21 Thread biorn
Your $sql already contains a mysql_query. Why are you running it against it again, unless you have changed something. If $sql only contains your delete statement(without calling mysql_query), then do not put quotes around $sql,$dbh Otherwise, come back with what $sql and $dbh are assigned to

[PHP-DB] Re: ORDER BY question

2002-02-21 Thread pixelpeter
Good article on phpbuilder.com Slapping together a search engine for your database is easy with PHP and MySQL http://phpbuilder.com/columns/clay19990421.php3 [ p i x e l p e t e r ] [EMAIL PROTECTED] Chris Payne [EMAIL PROTECTED] schrieb im Newsbeitrag

[PHP-DB] Help needed - need to access a value from DB into all pages

2002-02-21 Thread WG4- Cook, Janet
Hi there, I am struggling with a concept and can't seem to find a way to do it so hoping you all can help. We want to use PHP with MySql Db. For security reasons on the DB, it is to be accessed only through this front end i.e. via the internal web Each user will have a number of levels of

[PHP-DB] RE: [PHP] Help needed - need to access a value from DB into all pages

2002-02-21 Thread Martin Towell
I can think of three ways you could do this. 1. as a cookie 2. using sessions 3. put it in every link Martin -Original Message- From: WG4- Cook, Janet [mailto:[EMAIL PROTECTED]] Sent: Friday, February 22, 2002 10:59 AM To: PHP db list; PHP List Subject: [PHP] Help needed - need to

Re: [PHP-DB] RE: [PHP] Help needed - need to access a value from DB into all pages

2002-02-21 Thread William Fong
Sessions seems to be the popular way to go. It's stored at the server, so you don't have to worry about any clients disabling cookie support. -- William Fong - [EMAIL PROTECTED] Phone: 626.968.6424 x210 | Fax: 626.968.6877 Wireless #: 805.490.7732| Wireless E-mail: [EMAIL PROTECTED]

[PHP-DB] Re: Help needed - need to access a value from DB into all pages

2002-02-21 Thread Joe Van Meer
Hi there :) One of the most common methods of achieving this is by using session variables. First the user logins in through a form with a username and a password, you check these against the database to make sure they are who they say they are, once that is established you could create a

[PHP-DB] Re: Premature end of Script header

2002-02-21 Thread Pete Lacey
Try It looks like your quotes are out of whack. All those slashes are a little redundant too. Try print(A HREF=test.php?sid=$SIDReload/ABR\n); HTML does not mandate quotes around a parameter's value. I'm only guesing that your reference to SID was supposed to be a variable and that your

Re: [PHP-DB] Secure Encrypt/Decrypt Functions

2002-02-21 Thread Peter Janett
I too need a solution for this, but I don't think mcrypt will work. Why? I need public key/private key encryption, as I don't want to risk leaving the key on the server. From what I understand by reading the mcrypt docs, you encrypt and decrypt with the same key, so if someone were to be able

[PHP-DB] MySQL problem

2002-02-21 Thread Caleb Walker
I keep on getting this error statement: Warning: Supplied argument is not a valid MySQL result resource in /usr/local/www/data/phone/insert2.php on line 10 2 Can someone tell me what is wrong with the code below, I just cannot figure it out... Thank you very much in advance. I am using php4.

[PHP-DB] php-mysql insert via web form problem

2002-02-21 Thread pdsec
Hi, I am trying to write a web based form that I can put arbitrary sql statements into and run them against my mysql db. the form is written using php btw. For read operations this seems to work fine, i.e. select, describe, show etc. However, when I try to do an insert to a table I get an

Re: [PHP-DB] MySQL problem

2002-02-21 Thread Markus Lervik
On Fri, 2002-02-22 at 09:37, Caleb Walker wrote: I keep on getting this error statement: Warning: Supplied argument is not a valid MySQL result resource in /usr/local/www/data/phone/insert2.php on line 10 2 Can someone tell me what is wrong with the code below, I just cannot figure it

Re: [PHP-DB] php-mysql insert via web form problem

2002-02-21 Thread Marius Ursache
i think the query you are sending to mysql should be : insert into pages (page) values ('index') (without \) [EMAIL PROTECTED] a écrit : Hi, I am trying to write a web based form that I can put arbitrary sql statements into and run them against my mysql db. the form is written using php

[PHP-DB] Re: Special Insertion Into MySQL - at a loss!

2002-02-21 Thread Adam Royle
The following code is how you should retrieve the data from mySQL... if you wanted to update all of the information through one button, though, I would do it in a slightly different way... ?php $sql = SELECT whatever FROM whatever...; $result = mysql_query($sql); while ($row =