[PHP-DB] help me

2003-01-09 Thread khac duy
i can't use start_secsion(); in php4, it say: error : can't ofen(\tmp/4363jghsfjkhshga.. like this...

Re: [PHP-DB] help me

2003-01-09 Thread Martin Hudec
Hello khac, hmm what platform are you running on? what are PHP settings for writing sessions? Check out permissions for /tmp directory, check out free space on disk. -- Best regards, Martin mail [EMAIL PROTECTED] mobile

Re: [PHP-DB] help me

2003-01-09 Thread rblack
Are you running on windows or Linux??? This looks like a Windows problem - you have to set your SESSION_SAVE_PATH in php.ini AND make sure the folder you specify exists and is accessible to PHP. HTH, Richy == Richard Black Senior Developer,

RE: [PHP-DB] help me

2003-01-09 Thread Snijders, Mark
when using start_session the code tries to write a file to the tmp dir... think you are working under windows so make in c: a \tmp dir !!! then it should work -Original Message- From: khac duy [mailto:[EMAIL PROTECTED]] Sent: vrijdag 10 januari 2003 1:08 To: [EMAIL PROTECTED]

[PHP-DB] how use random in php

2003-01-09 Thread khac duy
in php only support shuffe(); function,i want random a array,how

RE: [PHP-DB] how use random in php

2003-01-09 Thread Snijders, Mark
check www.php.net and search for array... then you will get a list of all the array functions try to find it out yourself first please -mark- -Original Message- From: khac duy [mailto:[EMAIL PROTECTED]] Sent: vrijdag 10 januari 2003 1:15 To: [EMAIL PROTECTED] Subject: [PHP-DB] how use

[PHP-DB] LEFT JOIN not working

2003-01-09 Thread Lisi
I have a page with many ads that stores both the number of times an ad is displayed and how many times it gets clicked. These are stored in two different tables (since different information is stored for each) but both have identical name columns. I am trying to display both # times displayed

Re: [PHP-DB] LEFT JOIN not working

2003-01-09 Thread Ignatius Reilly
problem 1: move the WHERE clauses to the ON clauses problem 2: Obviously your intent with COUNT(ads_clickrate.date) is to count the number of non-null occurences of click. But COUNT() is not the appropriate function to do this (it will simply give you the number of rows inside a group). Try

Re: [PHP-DB] LEFT JOIN not working

2003-01-09 Thread Ignatius Reilly
Your 4th row ought to have an identifier of some sort. From your SELECT statement, this seems to be the name. Why does it not have a name? Probably what you want is a row with a name but a NULL value for ads_clickrate.date. (by the way it is EXTREMELY advisable to use an abstract identifier, such

Re: [PHP-DB] LEFT JOIN not working

2003-01-09 Thread Ignatius Reilly
Oops! Sorry, I missed it the first time. Your query should start as: SELECT ads_displayrate.name instead of SELECT ads_clickrate.name then you will always have a non-NULL name (coming from the table on the left of the LEFT JOIN). HTH Ignatius, from Brussels Where the fuck is Belgium? D.

[PHP-DB] two inserts at once?

2003-01-09 Thread Michael Knauf/Niles
This Code Snippet works: $newfaq_query = INSERT INTO `faq` (`faqid`, `question`, `answer`) VALUES ('', '$question', '$answer'); $newfeaturesResult = mysql_query($newfeatures_query); But I'd like to combine that query with this one: INSERT INTO `faqRelatedToProduct` (`id`, `fgNumber`, `faqId`)

[PHP-DB] [mysql - php] Newline to BR problem

2003-01-09 Thread Ro Stonemountain
I'm trying to place a text from a textfield into a database and displaying it on another page. All works fine and well but my problem is: If i place newline characters (press enter) in the forms textfield they don't show up on my display page. This is logical because newlines are not br codes. So

Re: [PHP-DB] two inserts at once?

2003-01-09 Thread Ignatius Reilly
If you are using MySQL, you can't. (none of my business, but why not simplifying your table names: faqProduct instead of faqRelatedToProduct ?) Ignatius - Original Message - From: Michael Knauf/Niles [EMAIL PROTECTED] To: [EMAIL PROTECTED]

[PHP-DB] preventing page from resubmitting when refreshing page

2003-01-09 Thread mike karthauser
I have a page that has a form on the first part that posts to itself and dumps the contents of the form into a database. All this is well and good - I'm using if ($_POST['submit']) { } to detect the submission and everything is doing as it should. Thing is if you refresh the page that

RE: [PHP-DB] [mysql - php] Newline to BR problem

2003-01-09 Thread Aaron Wolski
You want to look at nl2br() function. It takes newlines from a text like: Hello My name is Aaron Which when outputted normally would look like: Hello my name is aaron Using echo nl2br($dbquery); would produce: Hellobrbr My name isbrbr Aaronbrbr In your HTML code which then would output in

RE: [PHP-DB] preventing page from resubmitting when refreshing page

2003-01-09 Thread Hutchins, Richard
I use logic like this to avoid this problem: Submit data from form to a separate PHP script that handles the database submission then forwards to a results page which queries the database for the information from an ID passed along with the page forward. If you do this, when you refresh the

Re: [PHP-DB] preventing page from resubmitting when refreshing page

2003-01-09 Thread Chris Boget
Is there something i can do on browser refresh to prevent this or prevent my mysql database from duplicating the records? Instead of using INSERT in your query use REPLACE INTO. Alternately, after you are done processing the form, do this: header( location: $PHP_SELF?$QUERY_STRING ); exit()

Re: [PHP-DB] Authenticating through a php script

2003-01-09 Thread David Smith
Jeremy, LDAP authentication happens in two stages: connect and bind. The connect stage is just establishing a connection with the LDAP server (ldap_connect()). No username or password is necesary in this stage. Once your connection is established, you attempt a bind (ldap_bind())to verify a

[PHP-DB] If select query doesn't net any results

2003-01-09 Thread Michael Cortes
I am a programming novice and just created my first php application. However I have a situation I don't know the answer to. My db queries (mysql) are written like this: $qtrans= select * from $table where (conditionals) order by some field; $link=mysql_connect ($host, $user,

RE: [PHP-DB] If select query doesn't net any results

2003-01-09 Thread Ryan Jameson (USA)
if (mysql_num_rows($result) 1) { //do stuff } This is only this easy with mySQL... :-) Ryan -Original Message- From: Michael Cortes [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 09, 2003 11:07 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] If select query doesn't net any results

Re: [PHP-DB] If select query doesn't net any results

2003-01-09 Thread Chris Boget
I would like to created an if statement that only occurs if the query gets a result. If there are no records that meet the query conditionals and my array ends up with null, I do not want my if statement to take place. Is this easy enough to do? Any help would be great. if(

Re: [PHP-DB] two inserts at once?

2003-01-09 Thread Jason Wong
On Friday 10 January 2003 01:04, Michael Knauf/Niles wrote: This Code Snippet works: $newfaq_query = INSERT INTO `faq` (`faqid`, `question`, `answer`) VALUES ('', '$question', '$answer'); $newfeaturesResult = mysql_query($newfeatures_query); But I'd like to combine that query with this

Re: [PHP-DB] LEFT JOIN not working

2003-01-09 Thread Ignatius Reilly
Oops! I missed again. If you specify conditions pertaining to the right-hand table, such as: ads_clickrate.date = '2001', Then you will lose all result rows for which the right-hand data is NULL. Not the expected result. So your restricting WHERE clauses must apply to the left-hand table only.

Re: [PHP-DB] Authenticating through a php script

2003-01-09 Thread Jeremy Peterson
David, I have ldap working, my problem is the second half of my question. The problem script workflow: 1. Authenticate on LDAP (Resolved) 2. Connect to different authenticated site for the user (Not sure where to go now.) My guess was to send the post information to where the form action

[PHP-DB] Stumped...

2003-01-09 Thread NIPP, SCOTT V (SBCSI)
I am getting an error that is proving very difficult to isolate and was hoping for help. The error is: Column count doesn't match value count at row 1. I would include the code, but it is about 350 lines, and I am not sure where to narrow it down at. Any ideas? Thanks. Scott Nipp

RE: [PHP-DB] Stumped...

2003-01-09 Thread Hutchins, Richard
Post your SQL statement. -Original Message- From: NIPP, SCOTT V (SBCSI) [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 09, 2003 1:37 PM To: '[EMAIL PROTECTED]' Subject: [PHP-DB] Stumped... I am getting an error that is proving very difficult to isolate and was

Re: [PHP-DB] Stumped...

2003-01-09 Thread Jim
it sounds like you are doing an INSERT and the table has fewer columns then the VALUES clause has. Check your code for an INSERT statement then match your values up with the table structure, check for hidden commas in your value information. Jim ---Original Message--- From:

RE: [PHP-DB] Stumped...

2003-01-09 Thread NIPP, SCOTT V (SBCSI)
Nevermind. I just stumbled across the nature of my problem on Deja.com. Thanks anyway and sorry for bugging you guys about what really was a simple problem. -Original Message- From: Hutchins, Richard [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 09, 2003 12:36 PM To: NIPP,

Re: [PHP-DB] If select query doesn't net any results

2003-01-09 Thread Doug Thompson
... if ($result) { while ($row... ... } $result will be 0 (false) if nothing satisfies the query. Any other comparison is just extra typing with no improvement in logic. Regards, Doug On Thu, 09 Jan 2003 13:06:51 -0500, Michael Cortes wrote: I am a programming novice

Re: [PHP-DB] two inserts at once?

2003-01-09 Thread Michael Knauf/Niles
Well what do ya know, this works! Thanks for the pointer. if ($tableid==newfaq) { echo adding FAQBR; $newfaq_query = INSERT INTO `faq` (`faqid`, `question`, `answer`) VALUES ('', '$question', '$answer'); $newfaqResult = mysql_query($newfaq_query); $newfaq_query2 = INSERT

Re: [PHP-DB] Authenticating through a php script

2003-01-09 Thread David Smith
I haven't looked over all your code in detail, but the problem you describe seems to be best solved using PHP Sessions. Sessions store data between browser refreshes. You could store whether a user has been authenticated via LDAP, and then on a subsequent page, you can reference that information

[PHP-DB] which DBMS... MySQL or PostgreSQL

2003-01-09 Thread dufronte
I want to start my Open-Source Project.. PHP-Based RPG Webgame in the next 2 months.. Till now, I still confuse in choosing 2 DBMS. MySQL and PostgreSQL. In your opinions, which DB should I use in consider that my Game will content a very big database including Player data, player Stats, Story

Re: [PHP-DB] which DBMS... MySQL or PostgreSQL

2003-01-09 Thread Jason Wong
On Friday 10 January 2003 03:48, dufronte wrote: I want to start my Open-Source Project.. PHP-Based RPG Webgame in the next 2 months.. Till now, I still confuse in choosing 2 DBMS. MySQL and PostgreSQL. In your opinions, which DB should I use in consider that my Game will content a very big

RE: [PHP-DB] which DBMS... MySQL or PostgreSQL

2003-01-09 Thread dufronte
Oh yeah.. I see... thx for the info... #Please join Open Community Forum... http://openity.tk #We're free to discuss anything ---DuFronte--- http://kapsul.org No Fuckin' Shits !! -Original Message- From: Jason Wong [mailto:[EMAIL PROTECTED]] Sent: Friday, January 10,

RE: [PHP-DB] which DBMS... MySQL or PostgreSQL

2003-01-09 Thread dufronte
Hmm.. so it means that I should choose PG ??? #Please join Open Community Forum... http://openity.tk #We're free to discuss anything ---DuFronte--- http://kapsul.org No Fuckin' Shits !! -Original Message- From: Jason Wong [mailto:[EMAIL PROTECTED]] Sent: Friday, January

Re: [PHP-DB] which DBMS... MySQL or PostgreSQL

2003-01-09 Thread Chris Boget
Hmm.. so it means that I should choose PG ??? That's not something we can answer as it very much depends on your needs. Look at the features that PG has v. the features that MySQL has and decide based on that. If you don't need the functionality PG offers that MySQL doesn't, go with MySQL as

Re: [PHP-DB] OR on multiple columns

2003-01-09 Thread David Chamberlin
Jason Wong wrote: On Thursday 09 January 2003 08:36, David Chamberlin wrote: I was reading the mysql docs and noticed a section on searching on multiple keys (stupid question - keys=columns?). It says doing an OR on multiple keys is inefficient, and you should use a temp table. Here's their

RE: [PHP-DB] If select query doesn't net any results

2003-01-09 Thread John W. Holmes
... if ($result) { while ($row... ... } $result will be 0 (false) if nothing satisfies the query. Any other comparison is just extra typing with no improvement in logic. No, it only returns false/0 if the query fails, meaning there was an error and the query couldn't be

[PHP-DB] Design suggestions - performance improvement

2003-01-09 Thread Matthew Nock
Hi all, I am currently building a site for a cinema to display session times, film synopsis' etc... I have built the database as follows: TABLE: film_detail FilmID FilmName FilmRunTime FilmRating FilmSynopsis etc... TABLE session_data session_ID session_filmID session_StartTime session_Date

Re: [PHP-DB] Authenticating through a php script

2003-01-09 Thread Jeremy Peterson
Dave, I am afraid I am not communicating what I am trying to do. I have multiple databases that my library purchases. FirstSearch, Ebscohost, etc. These company's have there own authentication systems that I have no control over. A lot of them give user names and passwords that can access

[PHP-DB] Examine button

2003-01-09 Thread Sabina A. Schneider
Hello everybody!!! I'm writing to you to ask if somebody knows how can I do to emulate the examine button to retrive a file's path to save that string in the database. Specifically, it's a photo, that've got to search in the directory's window. Thanks in advance! Sabina Alejandra

RE: [PHP-DB] Examine button

2003-01-09 Thread John W. Holmes
Hello everybody!!! I'm writing to you to ask if somebody knows how can I do to emulate the examine button to retrive a file's path to save that string in the database. Specifically, it's a photo, that've got to search in the directory's window. Thanks in advance! Yeah, you probably

Re: [PHP-DB] resetting $res from mysql_fetch_row()?

2003-01-09 Thread Donny Lee
John W. Holmes wrote: any hint on resetting a $res from mysql_fetch_row()? www.php.net/mysql_data_seek Thanks, does help. -- // Donny -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DB] Relationship or not.

2003-01-09 Thread Bruce Levick
I have a bit of a challenge on and only being a newbie I will need to call on some experienced PHP'ers. I have two tables in a databse. Tasks and Files. They relate to each other via Tasks.ID and Files.FID. I have successfully created an uploading form which adds images to a directory and

RE: [PHP-DB] Relationship or not.

2003-01-09 Thread Bruce Levick
I forgot to mention there will likely be more than the one file that relates to a task. -Original Message- From: Bruce Levick Sent: Friday, January 10, 2003 2:40 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Relationship or not. I have a bit of a challenge on and only being a newbie I

Re: [PHP-DB] OR on multiple columns

2003-01-09 Thread Jason Wong
On Friday 10 January 2003 06:41, David Chamberlin wrote: That may depend upon your particular circumstances, and hence running your own tests on both methods would give you the best answer. OK, so what's the best way to go about profiling this? Short answer: microtime() Long answer: check

RE: [PHP-DB] denying access to folders/files

2003-01-09 Thread Gary . Every
Gary Every Sr. UNIX Administrator Ingram Entertainment (615) 287-4876 Pay It Forward mailto:[EMAIL PROTECTED] http://accessingram.com This is fine and dandy, but how do I prevent that person from taking the direct link to the file and giving it to someone else? I'm sure there is a much better

RE: [PHP-DB] denying access to folders/files

2003-01-09 Thread John W. Holmes
Not sure what's the question or the answer below... but anyway. To protect your files, store them outside of the webroot or in the database and use a PHP file to serve them up. The PHP file will check the authentication or whatever of the user and if it's valid, serve up the file to them with a