RE: [PHP] unset a function?
include_once() won't help. In fact, he is including each file only once. He wants to have a function with the same name in each file. That's the kicker... -Original Message- From: Philip Olson [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 30, 2002 3:03 PM To: Bas Jobsen Cc: PHP List Subject: Re: [PHP] unset a function? This sounds like a job for include_once www.php.net/include_once regards, Philip Olson On Wed, 30 Jan 2002, Bas Jobsen wrote: Hello, I have this: ? include(file1); function_somename(); include(file2); function_somename(); ? file1 and contain a function definition, but the function in both files had the same name. This will give Cannot redeclare . So can i unset the function before the second include? Tnx, Bas -- PHP General 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 General 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 General 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] Sending an e-mail to 1,000 people
yes you can by using MYSQL to store the names, PHP to generate the letters (or you can store letter template in database as well), and PHP's mail() function will take you home. -Original Message- From: Ben Clumeck [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 29, 2002 1:43 PM To: [EMAIL PROTECTED] Subject: [PHP] Sending an e-mail to 1,000 people I would like to send an e-mail (the same e-mail) to 1,000 different people. I want each persons name to be in the To: field. Is there a way to customize it to where it can say Dear (having a different persons name corresponding to an e-mail address) so that it looks customized. Thanks, Ben -- PHP General 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 General 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] Sending an e-mail to 1,000 people
1. Create a mysql database with the names. You would have to enter all the names and addresses into the database. 2. Create a PHP program which would read the names from the database. The names would go into a variable. 3. Using a template letter in the PHP program, insert the names (from the variable's values) into the template. 4. Call PHP's mail() function to send the emails. Then, in the future, you can simply change the letter template in the PHP script and easily send the new email to the 1000 recipients. Note: I mean you no insult. But, do you know how to script using PHP and MYSQL? If not, that's a whole other matter. rick -Original Message- From: Ben Clumeck [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 29, 2002 3:02 PM To: Rick Emery Subject: RE: [PHP] Sending an e-mail to 1,000 people Thanks for your response. How would it know who to send it to? Would I have to input all the names separtely into the mail() function? Or would it be a variable? Not quite sure on how to do it. Thanks for your help. Ben -Original Message- From: Rick Emery [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 29, 2002 12:00 PM To: 'Ben Clumeck'; [EMAIL PROTECTED] Subject: RE: [PHP] Sending an e-mail to 1,000 people yes you can by using MYSQL to store the names, PHP to generate the letters (or you can store letter template in database as well), and PHP's mail() function will take you home. -Original Message- From: Ben Clumeck [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 29, 2002 1:43 PM To: [EMAIL PROTECTED] Subject: [PHP] Sending an e-mail to 1,000 people I would like to send an e-mail (the same e-mail) to 1,000 different people. I want each persons name to be in the To: field. Is there a way to customize it to where it can say Dear (having a different persons name corresponding to an e-mail address) so that it looks customized. Thanks, Ben -- PHP General 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 General 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] Got a problem I cant figure out
SHOW US YOUR CODE -Original Message- From: Ben Turner [mailto:[EMAIL PROTECTED]] Sent: Sunday, January 27, 2002 10:56 PM To: [EMAIL PROTECTED] Subject: [PHP] Got a problem I cant figure out Parse error: parse error in /var/www/docs/tacklebox/404handler.php on line 47 I am receiving this error on my page but the problem is that line 47 is the ? and last line of the page. Is their something Im missing here?? Thanks, Ben -- PHP General 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] MySQL queston - Which row does it put your info into?
When records are deleted, the space they occupied are marked as vacant. New records are inserted into those locations. That said, since this is a relational database, it really doen't matter where the new records are inserted. If you want the nitty-gitty details of MYSQL or help, go to the the [EMAIL PROTECTED] mailing list -Original Message- From: Phil Schwarzmann [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 24, 2002 1:15 PM To: [EMAIL PROTECTED] Subject: [PHP] MySQL queston - Which row does it put your info into? When Im adding rows into my MySQL database using PHP, it seems to put them in random places in the database. Sometimes at the beginning, sometimes at the end, sometimes in the middle of the database. Why is it doing this? Thanks for your help!! -- PHP General 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] Re: while loop on an array
You don't need to know when you hit the end. Rather, simply remove the last || after the completion of the loop. while (list($new_qID,$new_aID) = each ($new_answers)) { $sql .= qID=\$new_qID || \; } $sql .= substr( $sql, 0, -3) .) AND uID = \$uID\; -Original Message- Joe Rice [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]... Hello, I would like to know how i can know when i'm at the end of an array during a while loop? reset($new_answers); while (list($new_qID,$new_aID) = each ($new_answers)) { $sql .= qID=\$new_qID\ || ; } $sql .= ) AND uID = \$uID\; i would like to know how to stop putting the || at the end of $sql in the middle of the while loop. any help would be appreciated. thanks, joe -- PHP General 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 General 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] What is going on here? list() = each()
change to: ? $var = this.that; list( $thisVal, $thatVal ) = explode( ., $var ); echo $thisVal, $thatVal ? -Original Message- From: Chris Boget [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 23, 2002 3:43 PM To: PHP-General Subject: [PHP] What is going on here? list() = each() ? $var = this.that; list( $thisVal, $thatVal ) = each( explode( ., $var )); echo $thisVal, $thatVal ? What is getting echo'd out is: 0, this Why? What am I missing here? Chris -- PHP General 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 General 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] Correction
$newlines = nl2br($oldline); print $newlines; The $oldline would contain text which contains newline characters. -Original Message- From: Scott Fletcher [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 23, 2002 3:57 PM To: [EMAIL PROTECTED] Subject: [PHP] Correction I mean how to make the data in HTML to work like a Line Feed? That way, the data are all align! Thanks, Scott -- PHP General 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 General 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] can anyone explain this error ?
It means you are trying to insert 22 values into 20 fields -Original Message- From: Matthew Darcy [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 23, 2002 4:11 PM To: PHP developers Subject: [PHP] can anyone explain this error ? I am doing an insert into a EMPTY mysql table. 1 field is an auto increment. here is the error I get when I do the insert Column count doesn't match value count at row 1 What does this mean ? Here is the php used to insert it. ?php include(../dbconnect.php); if ($submit == sign!) { $query = insert into account_details (account_number, account_type, account_name, account_address, account_addres1, account_address2, account_address3, account_address4, account_address5, account_contact, account_phone, account_fax, account_email, account_start_date, account_authorised_credit, account_pin, account_disabled_flag, metered_jobs, unmetered_jobs, account_pin_activate) values ('$account_number', '$account_type', '$account_name', '$account_house', '$account_street', '$account_street1', '$account_street2', '$account_town', '$account_city', '$account_postcode', '$account_country', '$account_contact', '$account_phone', '$account_fax', '$account_email', '$account_start', '$account_credit_authorised', '$account_pin', '$account_disabled_flag', '$metered_job_count', '$unmetered_job_count', '$account_pin_activated'); mysql_query($query) or die (mysql_error()); ? H2 Data Submitted /H2 H2 A HREF=view_test_records.php View the records /A/H2 ?php } else { include(datafillcommit.php); } ? ~ Thanks, Matt. -- PHP General 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 General 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] What do you mean?
First, no such PHP function exists which will fix up the amount of spaces for each lines to make the end of each line to be all aligned. Second, you could verify that in section LXXXIII. String functions of the PHP manual before asking. Third, please keep the same subject line. It makes following the thread easier. -Original Message- From: Scott Fletcher [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 23, 2002 4:24 PM To: [EMAIL PROTECTED] Subject: [PHP] What do you mean? What do you mean? There is a php function that can clean up the carriage return and line feed. There's a php function somewhere that will fix up the amount of spaces for each lines to make the end of each line to be all aligned. So, what would it be? Thank, Scott -- PHP General 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 General 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] encrypting passwords, how to decrypt?
Did you try print $query to ensure it contained what you expected? -Original Message- From: Hawk [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 17, 2002 2:54 PM To: [EMAIL PROTECTED] Subject: [PHP] encrypting passwords, how to decrypt? Ok, even if I don't need encryption I thought I might go ahead and try to learn it, and as I said in the previous post I managed to get it working everywhere but on the login script first I have a form that sends username and password to login.php, in that file I have something like this ? $the host user pswd and db vars mysql_connect($host, $user, $pswd); mysql_select_db($db); $query = SELECT * FROM users WHERE username='$username' and password='$password'; $result = mysql_query($query); $num = mysql_num_rows($result); if ( $num != NULL ) { session_start(); session_register(admin_allow); $admin_allow = mytopsecretpassword; header(location: admin/index.php); } else { header(location: admin.php); } ? I know it looks messy, and I removed some stuff to make it smaller to post, but when I use non encrypted passwords this works fine, my problem is that I don't know how to to do read a encrypted password in the $query, or if I need to do it in some other way(been trying a few different this far) I tried with $query = SELECT * FROM users WHERE username='$username' and password=password('$password'); but that made $num = 0, and the login fail I'm getting really tired (from sleeping to little..) and that might have reduced my thinking even more than usual, but what am I doing wrong ? :P Hawk -- PHP General 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 General 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] Beginner: Open URL
In your original post (see below), you stated that that you wanted A tag functinality, which would involve the user clicking. In your last post, you state that you do not want the user to click; which is it to be? Now, your question is really about re-direction based upon a condition, whereby the user does not clisk a link, then the answer is: ? if(this happens) { header(Location:somepage.php); } else header(location:anotherpage.php); ? However, this snip must be executed before anything else is sent. It WILL NOT be displayed. Rather, the user will automatically be delivered to the referenced page. -Original Message- From: Tommi Trinkaus [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 16, 2002 3:44 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Beginner: Open URL Hi Nick I'm not sure what you mean can you be a little more detailed? I can tell however that PHP is *not* a substitute for HTML. If you want something like the a tag then *use* the a tag. in fact i want something like the a tag, but the new url should be opened within a php if-statement, not by user-clicking. Is that more detailed for you? thanks, tommi -Original Message- From: Tommi Trinkaus [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 16, 2002 2:04 AM To: [EMAIL PROTECTED] Subject: [PHP] Beginner: Open URL Hi over there, i'm just beginning with php and i wonder if it is possible to show another url in the current window like the a Tag in HTML. Thanks for any answer... tommi -- PHP General 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 General 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] variable problem - help!
$row[coloumname_${v$ariable}] -Original Message- From: Dani [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 16, 2002 8:36 AM To: [EMAIL PROTECTED] Subject: [PHP] variable problem - help! Importance: High Hi! I 'm trying not to hard code my php coding and I'm trying to pass a variable name into the $row[coloumname_$variable]; I get an error message for this code. I'm just wondering if I could do this trick using other ways of writing it. Thanks for reviewing! regards, Dani -- PHP General 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 General 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] Help !! Mail Function Problem (Newbie)
Put quotes around the TO address: mail([EMAIL PROTECTED], Subject, Line 1\nLine 2\nLine 3); -Original Message- From: Simos Varelakis [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 16, 2002 12:07 PM To: [EMAIL PROTECTED] Subject: [PHP] Help !! Mail Function Problem (Newbie) Hello to everyone My problem is that Mail function sends no e-mail the code is mail([EMAIL PROTECTED], Subject, Line 1\nLine 2\nLine 3); this is my /var/spool/mail/info log file thewall sendmail[4513]: g0H10I604513: from=apache, size=0, class=0, nrcpts=0, relay=apache@localhost this is the /etc/php.ini file [mail function] ;SMTP = localhost ;for win32 only ;sendmail_from = root@localhost ;for win32 only sendmail_path =/usr/sbin/sendmail -t Any Ideas ?? Thanks in advance Simos -- PHP General 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 General 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] find and replace help.. VERY important
If you're on a unix/linux system, you can use an AWK script -Original Message- From: Peter Sienkiewicz [mailto:[EMAIL PROTECTED]] Sent: Wednesday, January 16, 2002 2:32 PM To: [EMAIL PROTECTED] Subject: [PHP] find and replace help.. VERY important Hello ladies and gentlemen, I need a function that opens up an HTML file and looks for position:absolute;top:1038px;left:104px then changes the left: value to be 100 less then it currently is so it should then look like position:absolute;top:1038px;left:4px The problem is that the left: value changes from line to line This is a very important script, and I need it to search and replace thru 400 files. If anyone has an tips, please help. Thank You for your time. Peter -- PHP General 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] Change column in mysgl
ALTER TABLE mytable CHANGE COLUMN adress VARCHAR(40); -Original Message- From: Jan Grafström [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 15, 2002 5:11 AM To: [EMAIL PROTECTED] Subject: [PHP] Change column in mysgl Hi! Can I change this column adress VARCHAR(25) to adress VARCHAR(40) afterwards. I use mysql. Thanks for any help Regards, Jan -- Jan Grafström Lillemans Hus AB Bredsäter 2091 87010 Älandsbro 0611-60920 070-6409073 -- PHP General 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 General 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] Change column in mysgl
ALTER TABLE mytable CHANGE COLUMN adress VARCHAR(40); -Original Message- From: Jan Grafström [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 15, 2002 5:11 AM To: [EMAIL PROTECTED] Subject: [PHP] Change column in mysgl Hi! Can I change this column adress adress VARCHAR(25) to adress VARCHAR(40) afterwards. I use mysql. Thanks for any help Regards, Jan -- Jan Grafström Lillemans Hus AB Bredsäter 2091 87010 Älandsbro 0611-60920 070-6409073 -- PHP General 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 General 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] Passing variables with include()
Does http://www.someremote.server/calculate_drivers.php; contain a function? If so, you may have to declare $serie_id as global within it. -Original Message- From: Imar de Vries [mailto:[EMAIL PROTECTED]] Sent: Monday, January 14, 2002 5:53 AM To: [EMAIL PROTECTED] Subject: [PHP] Passing variables with include() Hi all, at this moment I am working on a script that calculates standings of our online racing competition. In order to do that, I have to connect to a database on a remote server. I have read in the php manual that [quote] When a file is include()ed, the code it contains inherits the variable scope of the line on which the include() occurs. Any variables available at that line in the calling file will be available within the called file. If the include() occurs inside a function within the calling file, then all of the code contained in the called file will behave as though it had been defined inside that function. [/quote] But for some reason, i simply do not get the script to work. I use a form in the local script to determine which standings are to be shown, and the value is stored in $serie_id. This is done in the main scope (no function used). $serie_id can be 2, 3 or 4. Then I make an include call to the remote script: include(http://www.someremote.server/calculate_drivers.php;); In that remote script I use $serie_id to make a database query. But so far, the query fails because $serie_id is not known. Are there any known exceptions (f.i. specific server settings) that might explain why the variable is not known on the remote server? Thanks in advance! -- Imar de Vries - [EMAIL PROTECTED] - ICQ 6972439 -- PHP General 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 General 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] Getting data from DB
Dani, you need to aska a specific question for us to help you. -Original Message- From: Dani [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 10, 2002 10:01 AM To: PHP LIST Subject: [PHP] Getting data from DB Hi! I'm trying to make a webpage which can be edited online. My problem is the text that I need to be edited will contain of title and sub title (here is an example of the layout) Room for Rent (picture of the room) bala bala . . -- PHP General 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 General 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] headers showing up in browser
what does your code look like? -Original Message- From: Mark [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 10, 2002 1:17 PM To: PHP Subject: [PHP] headers showing up in browser I've got this problem that won't go away. The headers are showing up at the top of the page when I run php in cgi mode. any ideas? thanks, - Mark -- PHP General 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 General 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] does this work?
Show all your code. Did you open a connection to the MYSQL server? If so, show the code. -Original Message- From: Erik Price [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 10, 2002 3:29 PM To: PHP Subject: [PHP] does this work? It seems that I have a parse error somewhere in the following code (since that's the only code in my script, it's a test script): // arraytest.php $tempsql = SELECT COUNT(*) AS count FROM divisions; $tempresult = mysql_query($tempsql, $db); $temprow = mysql_fetch_array($tempresult); echo $temprow[count]; Yet, it works fine in the mysql client. Thus, I am led to believe that PHP is not capable of constructing the same kinds of SQL statements that can be constructed in the mysql client. Is this the case? Erik PS: what I am -really- trying to do is dynamically fill in a select listbox with options that correspond to all of the records in a given table. Like so: form select ?php foreach ($record_id_and_record_name_pair_pulled_from_mysql_query) { print(option value=\${record_id}\${record_name}/option); } ? /select /form but I am unsure of how to grab multiple values from the mysql_query() and load them into an array. Has anyone done this before? -- PHP General 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 General 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] does this work?
Show all your code. Did you open a connection to the MYSQL server? If so, show the code. What is the exact error that you get? -Original Message- From: Erik Price [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 10, 2002 3:29 PM To: PHP Subject: [PHP] does this work? It seems that I have a parse error somewhere in the following code (since that's the only code in my script, it's a test script): // arraytest.php $tempsql = SELECT COUNT(*) AS count FROM divisions; $tempresult = mysql_query($tempsql, $db); $temprow = mysql_fetch_array($tempresult); echo $temprow[count]; Yet, it works fine in the mysql client. Thus, I am led to believe that PHP is not capable of constructing the same kinds of SQL statements that can be constructed in the mysql client. Is this the case? Erik PS: what I am -really- trying to do is dynamically fill in a select listbox with options that correspond to all of the records in a given table. Like so: form select ?php foreach ($record_id_and_record_name_pair_pulled_from_mysql_query) { print(option value=\${record_id}\${record_name}/option); } ? /select /form but I am unsure of how to grab multiple values from the mysql_query() and load them into an array. Has anyone done this before? -- PHP General 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 General 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] does this work?
quotes are not needed -Original Message- From: Kevin Stone [mailto:[EMAIL PROTECTED]] Sent: Friday, January 11, 2002 3:26 AM To: Erik Price; PHP (E-mail) Subject: Re: [PHP] does this work? Hmm I believe that the mysql_query() function requires quotes around the query statement even it it is being passed as a variable.. mysql_query($tempsql, $db); -Kevin It seems that I have a parse error somewhere in the following code (since that's the only code in my script, it's a test script): // arraytest.php $tempsql = SELECT COUNT(*) AS count FROM divisions; $tempresult = mysql_query($tempsql, $db); $temprow = mysql_fetch_array($tempresult); echo $temprow[count]; Yet, it works fine in the mysql client. Thus, I am led to believe that PHP is not capable of constructing the same kinds of SQL statements that can be constructed in the mysql client. Is this the case? Erik PS: what I am -really- trying to do is dynamically fill in a select listbox with options that correspond to all of the records in a given table. Like so: form select ?php foreach ($record_id_and_record_name_pair_pulled_from_mysql_query) { print(option value=\${record_id}\${record_name}/option); } ? /select /form but I am unsure of how to grab multiple values from the mysql_query() and load them into an array. Has anyone done this before? -- PHP General 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 General 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 General 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] can u find error in php file?
Given the simplicity of the mail() function, why go to all this trouble? I must be missing something here. Does your PHP host lack SMTP, so you must use another server's SMTP? -Original Message- From: Balaji Ankem [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 08, 2002 3:25 AM To: [EMAIL PROTECTED] Subject: [PHP] can u find error in php file? ?php include_once('Mail/smtp.php'); include_once('Net/SMTP.php'); # Replace 127.0.0.1 with another SMTP host if needed $smtp_session = new Mail_smtp(array('10.145.0.18', 25, TRUE, '', '')); $headers['Subject'] = 'Sample subject'; $headers['Reply-To'] = '[EMAIL PROTECTED]' mailto:'[EMAIL PROTECTED]' ; $headers['From'] = '[EMAIL PROTECTED]' mailto:'[EMAIL PROTECTED]' ; $headers['User']='bankem'; $headers['Password']='narayana'; $recipients = array( '[EMAIL PROTECTED]' mailto:'[EMAIL PROTECTED]' ); $body = EOF This is a sample body. EOF; $return = $smtp_session-send($recipients, $headers, $body); if ($return) echo Mail was successfully sent to [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ; else echo FAIL; ? for above program I am getting Mail was successfully sent to [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] . But actually no mail was received by me. -Balaji
[PHP] RE: [PHP-DB] php+mysql simple query help me pls! ty.
Test the mysql_query() return value: $result = mysql_query(SELECT * FROM members) or die(Error:.mysql_error()); there may be an error in your query. -Original Message- From: louie miranda [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 03, 2002 1:59 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: [PHP-DB] php+mysql simple query help me pls! ty. Hi, can someone help me here! :( I can't query the data on my sql from php. db is fine, i couldnt see the prob in php! pls help, ty. # MSQL ### mysql desc members; +--+-+--+-+-++ | Field| Type| Null | Key | Default | Extra | +--+-+--+-+-++ | id | tinyint(5) | | PRI | NULL| auto_increment | | ircname | varchar(30) | YES | | NULL|| | email| varchar(30) | YES | | NULL|| | realname | varchar(40) | YES | | NULL|| | asl | varchar(30) | YES | | NULL|| | info | varchar(70) | YES | | NULL|| +--+-+--+-+-++ # PHP html body ?php $db = mysql_connect(my_db_host, my_db_user, my_db_pass) or die(Could not connect); mysql_select_db(mydb,$db); $result = mysql_query(SELECT * FROM members,$db); printf(ircname: %sbrn, mysql_result($result,0,ircname)); printf(email: %sbrn, mysql_result($result,0,email)); printf(realname: %sbrn, mysql_result($result,0,realname)); printf(asl: %sbrn, mysql_result($result,0,asl)); printf(info: %sbrn, mysql_result($result,0,info)); ? /body /html # ERROR Warning: Supplied argument is not a valid MySQL result resource in /mnt/host-users/cavite/irc/members/t2.php on line 13 ircname: n Warning: Supplied argument is not a valid MySQL result resource in /mnt/host-users/cavite/irc/members/t2.php on line 14 email: n Warning: Supplied argument is not a valid MySQL result resource in /mnt/host-users/cavite/irc/members/t2.php on line 15 realname: n Warning: Supplied argument is not a valid MySQL result resource in /mnt/host-users/cavite/irc/members/t2.php on line 16 asl: n Warning: Supplied argument is not a valid MySQL result resource in /mnt/host-users/cavite/irc/members/t2.php on line 17 info: n -- 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 General 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] RE: What is causing duplicate keys?
it should read: INSERT INTO recensioni VALUES( NULL,... In order fot auto_increment to work, you must use NULL. When you tried NULL, what SPECIFIC error did you get when it complained? FYI: it complains about the duplicate key because you already inserted a record with 300 in the PRIMARY KEY field. When you attempt to insert the next key with 300, that is an error. -Original Message- From: mweb [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 05, 2001 1:16 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: What is causing duplicate keys? Hello, Always struggling on my php-odbc-MS access project, I managed to successfully add a record to a table. Now, no matter what I write in the first field (random numbers, AUTO, AUTO_INCREMENT...) I get this: Insert Into recensioni VALUES (300, 'riee', 'reworew', 'wer', 2001,'IT', 2.5, 'dond to it, 'rew', 'uno',1, 'Caro', 3, 'stuff', 20011205201040, 'writeurl, 1, '5/12/2001 20.10.40', '1', '1','enter keyword') Warning: SQL error: [Microsoft][ODBC Microsoft Access Driver] The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again., SQL state 23000 in SQLExecDirect in C:\domini\mnet\inser_rec.php on line 109 Error in odbc_exec( no cursor returned ) How can I find out what I am duplicating? The first field is the unique key, but what should I send to Access to tell it just auto increment and go? If I put 0 or NULL it complains. Also, Andrew Hill siggested the use of odbc_tables and odbc_columns to get info about the structure of each column which I don't know in detail because the DB was written by the guy who quit, not me) What is the exact syntax of those instructions? I have tried to apply the manual, but without success on the second one. TIA, mweb - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php -- PHP General 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] RE: MySQL ORDER BY or PHP Sort?
SELECT * FROM mytable ORDER BY series,price; -Original Message- From: René Fournier [mailto:[EMAIL PROTECTED]] Sent: Monday, December 03, 2001 4:27 PM To: [EMAIL PROTECTED] Subject: MySQL ORDER BY or PHP Sort? I want to select about 25 rows from a table, and sort them by two criteria. First, by each row's Series field (Baby, Genesis, Super, Predator, Millennium are the various Series, and the order I'd like the rows in the array). Within each Series, I'd like the rows sorted by their Price field, ascending. For example: Baby $5 Baby $10 Baby $15 Genesis $20 Genesis $35 Genesis $50 ...and so on. Now, I know how to structure my MySQL Select statment such that the rows it pulls from the table will be either sorted by Price OR by Series, but not both, in the way I'd like. Does anyone know if it's possibly to do this in the Select statement itself? (I'd rather do it that way, than resort in PHP.) Thanks! ...Rene --- René Fournier [EMAIL PROTECTED] - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php -- PHP General 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] RE: [PHP-DB] restoring mysql db after mysqldump
Are your privileges in MySQL set correctly? If ROOT doesn't have read/write access, the script will crash. rick -Original Message- From: Jay Paulson [mailto:[EMAIL PROTECTED]] Sent: Wednesday, August 22, 2001 11:29 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [PHP-DB] restoring mysql db after mysqldump Hello everyone- I have done the mysqldump function and got the db in a all_database.sql file. Now I am running this command at the shell prompt of my Linux machine: mysql -u root -p -e 'all_databases.sql' When I do that it works fine until it starts to insert the information into the database. I get the error that the table it is trying to read the information into is 'read only'... Is there anyway around this problem? Thanks, Jay -- 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 General 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]