Re: [PHP-DB] php, mysql security question

2004-03-31 Thread John Holmes
ser to connect from a specific host when you GRANT them permissions. Read the MySQL manual about the GRANT command. ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] One or Many Databases?

2004-07-31 Thread John Holmes
ome other features? It's not worth it and security and customization can be done just as easily with one database instead of many. Bottom line: use a single database. -- John Holmes php|architect - The magazine for PHP professionals - http://www.phparch.com -- PHP Database Mailing List (ht

Re: [PHP-DB] Eval a file, and it gives parse error because it uses a preg_match statement with \$

2004-08-02 Thread John Holmes
Josh Acecool M wrote: eval("?>" . $this -> The_Template_Sys . "Can you give an example of what $this->The_Template_Sys returns that is causing the parse error? -- John Holmes php|architect - The magazine for PHP professionals - http://www.phparch.com -- PHP Dat

Re: [PHP-DB] Problem with this query?

2004-08-02 Thread John Holmes
ers.ID IN ( SELECT UNIQUE tblVideos.PerformerID FROM tblVideos WHERE 1 =1 AND tblVideos.Active = 'yes') ORDER BY tblPics.ID DESC LIMIT 0 , 6 What version of MySQL are you using? It looks like you're using a version that doesn't support sub selects. -- John Holmes php|architec

Re: [PHP-DB] Problem with this query?

2004-08-02 Thread John Holmes
Dylan Barber wrote: 4.0.16 Quote: Starting with MySQL 4.1, all subquery forms and operations that the SQL standard requires are supported, as well as a few features that are MySQL-specific. http://dev.mysql.com/doc/mysql/en/Subqueries.html -- John Holmes php|architect - The magazine for PHP

Re: [PHP-DB] Regular Expression

2004-08-04 Thread John Holmes
"hkgx" or "bkkx" or "jktx" next 4 characters - numbers 0 to 9 next 1 character - a dash "-" next 3 characters - numbers 0 to 9 next 1 character - a dash "-" last 2 characters - numbers 0 to 9 (sin|hkg|bkk|jkt)x[0-9]{4}-[0-9]{3}-[0-9]{2} -- John

Re: [PHP-DB] Regular Expression

2004-08-04 Thread John Holmes
them? ^(sin|hkg|bkk|jkt)x[0-9]{4}-[0-9]{3}-[0-9]{2}$ Yeah, you should use them to ensure that the text is _only_ that code and not just contains it. Otherwise "asdf sinx1234-123-12 asdf" will pass. I just forgot. :) -- John Holmes php|architect - The magazine for PHP professionals -

Re: [PHP-DB] MSSQL INSERT query problem

2004-08-05 Thread John Holmes
he ?,?,? in your query have parenthesis around it?? $sql =& $db->prepare("INSERT INTO ExitSurveyAnswers (session_id, Question_id, answer) VALUES (?,?,?)"); -- John Holmes php|architect - The magazine for PHP professionals - http://www.phparch.com -- PHP Database Mailing List (htt

Re: [PHP-DB] bags o beans - filtering rows/array by value of an aggregated attribute

2004-08-05 Thread John Holmes
"\n\t {$data} "; print "\n"; } Thanks ahead of time for your thoughts and recipes :) Grant Are we doing your homework for you? Why not just do this in your query? SELECT bean_type, sum(number_o_beans)AS sum_beans FROM bags_o_beans GROUP BY bean_type HAVING sum_beans > 100

Re: [PHP-DB] MAIL() help needed :-(

2004-08-08 Thread John Holmes
nt-Type: text/html; charset=ISO-8859-1\r\n"; Not the best way to send an HTML message. It'll work on some mail clients and not on others. Best way is to send a multi-part message. Search Google for a tutorial. -- John Holmes php|architect - The magazine for PHP professionals - http://www.phparch.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] how do i install postgresql

2004-08-12 Thread John Holmes
ufuk wrote: Postgresql is running in my pc But i don`t use in php. What am i doing? Depends upon the OS, but you probably just have to uncomment the proper "extension" line in php.ini and restart your web server. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84A

Re: [PHP-DB] Joinging two different mySQL result?

2004-08-14 Thread John Holmes
is that you have to come up with a method to clear the cache. You can either clear it periodically (using cron, for example) or clear it when there is a change to either of the two tables it's built from (if you have control over those scripts). -- ---John Holmes... Amazon Wishlist: www.

Re: [PHP-DB] How to forward a POSTed form to another server and catch the return for further processing

2004-08-14 Thread John Holmes
#x27;http' => array( 'method' => 'POST', 'header' => "Content-Type: application/x-www-form-urlencoded\r\n" . 'Content-Length: '.strlen($data), 'content' => $data )); $context = stream_context_create($opts);

Re: [PHP-DB] SMTP

2004-08-16 Thread John Holmes
MTP = localhost SMTP = 587 -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] PHP5 not loading mysql.dll and mysqli.dll

2004-08-17 Thread John Holmes
case. Just ran through this _exact_ issue myself. Put the libmysql.dll files in the windows/system32/ directory. That fixed everything for me. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com -- PHP Dat

Re: [PHP-DB] Check Boxes

2004-08-18 Thread John Holmes
ut my problem is that in SELECT query command after each column name comma (,) is required and if i use the same than it is displaying "You have an error in your SQL syntax near 'FROM form' at line 1" How about showing us some code kind of hard to help without that... --

Re: [PHP-DB] Check Boxes

2004-08-18 Thread John Holmes
27;SELECT ' . implode(', ', $chkboxes) . 'FROM form'; Just note that with either solution, someone can post a value of "* FROM table WHERE 1#" and see everything in any table in your database. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BE

Re: [PHP-DB] NULL and empty space

2004-08-22 Thread John Holmes
#x27;s put in the query**) or to 'some value', when there is a values in $_FILES (note how there are quotes around the value if there is one **when it's put in the query**). Also notice how you're setting the "user_id" column to the _string_ 'NULL' instead

Re: [PHP-DB] Global Peace output

2004-08-22 Thread John Holmes
nk to $webaddress, no matter what it's value is? echo "Click Here"; Still following? Now, you want to display the address instead of "clicke here", right?? echo "$webaddress"; Still following? I hope so. If not, you need to find an HTML mailing list, if such a ho

Re: [PHP-DB] Global Peace output

2004-08-22 Thread John Holmes
x27;t work. Any guidance, please. Why don't you give an example of what you want, because I think you are very confused. Maybe English isn't your first language, but you're not making any sense. WTF is an "onclick link" other an an tag? This might require that you d

Re: [PHP-DB] letting a table name be a constant

2004-08-23 Thread John Holmes
x27;d do it like this: mysql_query("INSERT INTO " . TABLE . " (`id`,`name`) VALUES ('','$name')"); The other error you have, and I don't know how you think this code runs, are the dollar signs before mysql_connect(), mysql_select_db() and mysql_que

Re: [PHP-DB] Trap error

2004-08-24 Thread John Holmes
eporting() function. I don't use PG, but you should be able to then use something like pg_result_error() to capture errors like this and react accordingly. ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] PHP 5 mysql_fetch_array problems

2004-08-25 Thread John Holmes
array function in PHP 5.0.1 - the code listed below works fine with PHP 4.3.2. [snip] function fetchArray() { return(@mysql_fetch_array($this->result)); } First troubleshooting step is to remove the @, set error_reporting to E_ALL, and see if any errors, warnings, etc are shown. ---John Holme

Re: [PHP-DB] Update multiple tables

2004-08-26 Thread John Holmes
lexity) or use a database abstraction layer that simulates them. ADOdb comes to mind, although I've never used that feature. http://adodb.sourceforge.net ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Security Question

2004-08-27 Thread John Holmes
hing like include once "http://domain.com/include.php"; would that even work? It will work, but not like you're thinking. You'll get the _result_ of the PHP file and not the actual code. ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Dates - adding to unix 86400 seconds not equal next day

2004-09-01 Thread John Holmes
From: "ioannes" <[EMAIL PROTECTED]> "); $thisdate=date("d m Y",$next); print($thisdate); ?> I get 30 10 2004 31 10 2004 So what's the issue? You could also use this: print(date('d m Y H:i:s')); print(''); print(date('d m Y H:i:s&#

Re: [PHP-DB] Dates - adding to unix 86400 seconds not equal nextday

2004-09-01 Thread John Holmes
From: "ioannes" <[EMAIL PROTECTED]> When I run this code I get: 31 10 2004 31 10 2004 http://www.shortstay-london.com/testdates.php Try printing out the hours, minutes and seconds along with the date and you'll see the issue. ---John Holmes... -- PHP Database Mailing Lis

Re: [PHP-DB] Dates - adding to unix 86400 seconds not equal nextday

2004-09-01 Thread John Holmes
rst - 1099177200 - I get 1099177200+86400=1099263600 [day after first day above], but this gives me 11pm on 31 Oct as above. Daylight Savings Time strikes again!!! http://webexhibits.org/daylightsaving/b.html ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscr

Re: [PHP-DB] Dates - adding to unix 86400 seconds not equal nextday

2004-09-01 Thread John Holmes
t time starts from - 0059 on 31 Oct. Then, adding 24 hours still leaves you in the same day. There is an "I" tag in date() that'll return a 1 or 0 if it's DST and a flag in mktime() to account for DST, also. ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] PHP working but now Disobedient

2004-09-01 Thread John Holmes
se error: parse error, unexpected ';' in c:\inetpub\wwwroot\PTMemorandum6.php on line 89" Fix the missing ) in this line: Prob 2: Before the above error started, The following section was not creating 10 rows. [snip] That's because is outside of your loop... ---John Holmes... -- PHP

Re: [PHP-DB] PHP working but now Disobedient

2004-09-01 Thread John Holmes
gt; Although it's missing a semi-colon... ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Which Database Abstraction Layer ?

2004-09-01 Thread John Holmes
like this. Download both, implement both, run your own benchmarks and determine which one works best for you. If you need a specific feature set, then obviously choose the one that offers that. I'd personally recommend ADOdb for no other reason than that's what I use and it's effectiv

Re: [PHP-DB] Which Database Abstraction Layer ?

2004-09-02 Thread John Holmes
atures", etc... with nothing to actually back it up. Take opinions for what they are, I guess. They're not really worth much when you have specific needs like you've outlined above, IMO. If your question leads to some benchmarks being done or a complete comparison regarding fea

Re: [PHP-DB] Re: Another newbie question -- ANSWERED!!

2004-09-07 Thread John Holmes
column name that is either a reserved word or has special characters in it. If this is MySQL, it'll allow you to have column named called "order", "desc", "foo bar", etc, and not complain during the table creation. It will complain when it hits those reserved words in the queries, though, so that's why you use the backticks. ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] error of check box form

2004-09-08 Thread John Holmes
ters in the lines above. $db_host = "localhost"; etc... and read this http://us2.php.net/manual/en/language.types.string.php -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Inserting a seperator in long numbers

2004-09-08 Thread John Holmes
x27;/([0-9]{8})/','\1-',$number); although that leaves a - character on the end to strip off. I'm sure there are other ways. If you want a query to do this, then other than being off topic, it'd help if you told us what database you are using. Not everyone uses MySQL...

Re: [PHP-DB] grid unsetting vars

2004-09-09 Thread John Holmes
rray you can loop through. This may not matter for your code if "$value" is different each time and doesn't match any other form elements, though. How do you know this "doesn't work"? If you do a print_r($_REQUEST), do you see any of your checkbox values being p

Re: [PHP-DB] Newsletter and smtp

2004-09-09 Thread John Holmes
server. You may have to get permission or use special ports like the error message says. Why not set the SMTP value in php.ini to the AOL SMTP server instead of trying to run your own? ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.p

Re: [PHP-DB] mysq query without subselects

2004-09-10 Thread John Holmes
(total) AS total FROM T1 GROUP BY clientid; SELECT AVG(total) FROM tmp; But can't use subselects with mysqlhow do I do it?? Sure you can... with the right version. ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] One to Many Select Statement

2004-09-12 Thread John Holmes
nothing really wrong with that query. You can do that join this way, though, which may be more "proper": SELECT u.username, g.group_name FROM user u JOIN group g ON u.id = g.id WHERE u.id = 1 oh, and -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|archit

Re: [PHP-DB] mysql_connect dies silently

2004-09-13 Thread John Holmes
. If it just lists a directory, then that's where PHP expects to find the php.ini file. ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Using sessions to gather visitor information

2004-09-15 Thread John Holmes
$_SESSION = array(); will clear the session. If you unset() it, I don't think it's written at the end of the script, so your data remains. session_destroy() then probably fails because $_SESSION is gone or you never called session_start() on the page. ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Totally lost on why If statement doesn't work to call query

2004-09-15 Thread John Holmes
ot;"; echo $thissystem; //returns "C" echo ""; If($z==$thissystem) Try var_dump($z) to see if there are any extra characters returned in $z. ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Re: Accessing Matisse DB

2004-09-15 Thread John Holmes
Petrus Ali Saputra wrote: Petrus Ali Saputra wrote: Is there anyone here can tell me how to access Matisse DB? Thank you. Isn't there anyone can help me? ODBC? -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professi

Re: [PHP-DB] replacing dynamic variable in preg_replace

2004-09-15 Thread John Holmes
anyone can help it'd be much appreciated. preg_replace('/--(\w+)--/e','$$1',$code); -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Re: Accessing Matisse DB

2004-09-15 Thread John Holmes
Petrus Ali Saputra wrote: John Holmes wrote: Petrus Ali Saputra wrote: Petrus Ali Saputra wrote: Is there anyone here can tell me how to access Matisse DB? Thank you. Isn't there anyone can help me? ODBC? Yes, but it will lower the ability of Matisse. Sorry, you did not phrase that in the fo

Re: [PHP-DB] Sending mail through localhost

2004-09-17 Thread John Holmes
ot;, set the "sendmail_from" to a "charter.net" (for example) email address, then restart your web server and things should work. I'm no SMTP expert, so I can't tell you if any of this is the "best" way to do it or not, though... ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Passing URL parameters, how to hide

2004-09-19 Thread John Holmes
7;t going to fix anything. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Passing URL parameters, how to hide

2004-09-21 Thread John Holmes
nal security. If implemented correctly, they may not be a bad idea, but they should only be used in addition to an actual security setup like I described above. There may still be issues with your login code, how you're remembering who users are, etc... but that's another email. :) ---Jo

Re: [PHP-DB] Passing URL parameters, how to hide

2004-09-21 Thread John Holmes
will not update anything if they userID doesn't match and you can show an appropriate message (there's usually an "affected_rows()" function for your database that's useful here). You still need to validate "recordID" to ensure it's an integer before y

Re: [PHP-DB] Passing URL parameters, how to hide

2004-09-21 Thread John Holmes
are pretty much worthless unless you're on an intranet where you can control them. The IP address of a user can change in the middle of a session and multiple users can have the same IP address (using proxies, for example). I wouldn't rely on them for anything. ---John Holmes... -- PHP D

Re: [PHP-DB] Passing URL parameters, how to hide

2004-09-21 Thread John Holmes
are pretty much worthless unless you're on an intranet where you can control them. Thats why I said CAN, since it is unreliable That's why I said ARE, since I drive a Dodge. ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Passing URL parameters, how to hide

2004-09-21 Thread John Holmes
returned. Did I finally get this right ? You tell us; can you get to any other record? Sounds like you're heading in the right direction, though... ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Passing URL parameters, how to hide

2004-09-21 Thread John Holmes
en it's just a matter of determining what encryption method your using and your keys. Hard? Maybe... Impossible? No. ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Passing URL parameters, how to hide

2004-09-21 Thread John Holmes
s a waste. Also, with the above, if I were to change UserID to 5 (assuming that a valid userID) and recordID to 20 (assuming that's a valid recordID that userID 5 has access to), would I be able to see the record? I shouldn't be... ---John Holmes... -- PHP Database Mailing List (http:/

Re: [PHP-DB] unsubscribe me

2004-09-22 Thread John Holmes
From: "CJ Koh" <[EMAIL PROTECTED]> unsubscribe me I'm sorry, but you must phrase your request in the form of a question. ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] MultSelect ListBox hell!

2004-09-22 Thread John Holmes
at the form comes from the client. Just because you create the form with "state[]", that doesn't mean I'm going to send it that way. ;) If it was changed, it could cause an error that might expose file structure or whatever. So the check is a good thing to ensure nothi

Re: [PHP-DB] Possible bug in mysql_fetch_array et al

2004-09-22 Thread John Holmes
couple lines of code and still reproduce this? -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Suggestions for record insertion

2004-10-11 Thread John Holmes
ctions. Search your database's manual on how to use them. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] refresh the page on back

2004-10-14 Thread John Holmes
/Mozilla to achieve what you want... -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Converting Date for mysql

2004-10-14 Thread John Holmes
eally have just a DATE (instead of DATETIME/TIMESTAMP) column, then it'd be MMDD and -MM-DD (although any delimiter should work). $newdate = '20041231'; $query = "UPDATE table SET datecolumn = $newdate WHERE ... "; $newdate = '2004-12-31'; $query = "UPDATE

Re: [PHP-DB] Help: Transactions not working

2004-10-15 Thread John Holmes
(id,...) VALUES ($id,...)"; $query3 = "INSERT INTO (id,...) VALUES ($id,...)"; etc... -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Help: Transactions not working

2004-10-15 Thread John Holmes
ileID, P1, P2, Pgr, Eml2, Eml3) VALUES (null, LAST_INSERT_ID(), '$f1b', '$f1c', '$f1d', '$f1e', '$f1g')"; echo $query; $result = mysql_query($query); -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|ar

Re: [PHP-DB] moving from MS Access

2004-10-15 Thread John Holmes
this. Good luck. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] MySQL max records

2004-10-15 Thread John Holmes
pinfo()... I'm pretty sure the value is in there. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Passwords in MySQL for a PHP site

2004-10-03 Thread John Holmes
t handling passwords and authentication securely in your application." Your application should reset the password to some random value for the user rather than giving them their original back and force them to change it the next time they log on. -- ---John Holmes... Amazon Wishlist: w

Re: [PHP-DB] Auto-increment questions...

2004-10-05 Thread John Holmes
er from the old user 3000 is now related/linked to the new user 3000. How do you even tell there was an old user 3000? Wouldn't you want to be able to detect that? I'm sure there are other reasons, too... -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

Re: [PHP-DB] Convert a SQL compliant date to Epoc Unix seconds

2004-10-06 Thread John Holmes
Stéphane Pinel wrote: I'm looking for a simple way to convert a SQL compliant date (eg 2004-09-06) into a Unix Epoc seconds (similar to the one returned by function "time()"). strtotime() or the database may have something you can use in your query (like UNIX_TIMESTAMP() in MySQ

Re: [PHP-DB] HTML stored in a text field

2004-10-06 Thread John Holmes
d to show up in the table cell, then use what you have above. If you want the literal "word" to show up, then use this: echo '' . htmlentities($row['textfield']) . ''; -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architec

Re: [PHP-DB] mysql error and resource ID:

2004-10-18 Thread John Holmes
, you'll want to get the error before you run the rollback() function. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Aliased mysql queries and mysql_fetch_array()

2004-10-22 Thread John Holmes
oblem, you need to select the columns with aliases... $query = "SELECT people_1.first_name as p1_first_name, people.first_name as p_first_name, ..."; Now you'll have $row['p1_first_name'] and $row['p_first_name'] available. -- ---John Holmes... Amazon Wishlist: www.a

Re: [PHP-DB] Date Question

2004-10-27 Thread John Holmes
('Y-m-d',strtotime('09/24/2004')); -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: Re: [PHP-DB] Re: [EMAIL PROTECTED] November 2, 2004

2004-11-01 Thread John Holmes
he US. Thank you, but WRONG LIST! I see no reference to voting in the output of phpinfo(). Good day! ---John Holmes... UCCASS - PHP Survey System http://www.bigredspark.com/survey.html -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] configuration files

2004-11-11 Thread John Holmes
y based upon whatever separator you used. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] IIS and php sessions

2004-11-15 Thread John Holmes
r when installed as a module, which is the IUSR_ user by default 3. Sessions should work. Run a simple test to find out. Any issues, let me know. ---John Holmes... UCCASS - PHP Survey System http://www.bigredspark.com/survey.html replyAll Description: null -- PHP Database Mailing

Re: [PHP-DB] validate/sanitize data

2004-11-17 Thread John Holmes
l_escape_string http://us2.php.net/htmlentities -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] timestamp problem

2004-11-18 Thread John Holmes
27;t really think it's that great of a resolution. Use DATE_FORMAT() in your query to format the timestamp, TO_UNIXTIME() to retrieve a unix timestamp instead of a MySQL timestamp in your query, or use a couple substr() calls to pull out the pieces of the MySQL timestamp you need and the

Re: [PHP-DB] Optimize Query Output

2004-11-20 Thread John Holmes
is never going to look like that. You use PHP to format the result set so it displays how you want it. As you loop through the returned rows, keep track of what the current first and last name are. If they change, then output them, otherwise output a blank cell. -- ---John Holmes... Amazon Wishl

Re: [PHP-DB] php v jsp

2004-11-20 Thread John Holmes
isn't as simple as JSP vs. PHP vs. .NET, etc, many other things need to be taken into consideration, too. You may just have to accept that JSP is a better solution in this instance. Or you may weigh all of the above and decide it'd be stupid to not use PHP. -- ---John Holmes...

Re: [PHP-DB] 5 hours later - sql error.

2004-12-02 Thread John Holmes
egin with, so it can't be empty unless you're doing something to it. This smells of a scope issue to me, where you're creating $query_rsCS and $aWHERE in one function and then trying to access it in another without declaring it global first. -- ---John Holmes... Amazon Wishl

Re: [PHP-DB] 5 hours later - sql error.

2004-12-03 Thread John Holmes
ause your error, which we would have seen if you'd just posted the query... -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: Re: [PHP-DB] Re: sessions

2004-12-11 Thread John Holmes
riables in the URL/header/cookie data. You can still write horribly insecure programs with register_globals OFF. You can easily write very secure programs that function with register_globals ON or OFF, too. ---John Holmes... UCCASS - PHP Survey System http://www.bigredspark.com/survey.html

Re: [PHP-DB] save as you type

2004-12-12 Thread John Holmes
Matthew Perry wrote: Is there a way to make an input box save data into a database as users type? My users keep forgetting to press my "apply changes" buttons. Educate your users or use some JavaScript auto submit workaround. Not a PHP issue, though... -- ---John Holmes... Amazo

[PHP-DB] Turn off "out of offfice" messages for the list, please

2004-12-14 Thread John Holmes
ite annoying after a while, if you can imagine. Yes, I know how to filter them to my Junk folder, but let's try to stop it at the source instead, eh? ;) Happy Holidays, -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals

Re: [PHP-DB] Object oriented database in PHP?

2004-12-20 Thread John Holmes
> From: symbulos partners <[EMAIL PROTECTED]> > Has anybody implemented an object oriented database in PHP yet? No... PHP would not be a suitable programming language to create a database in... If you mean an OO abstraction layer to a database, however... then yeah. ---John Holme

Re: RE: [PHP-DB] PHP Classes to generate Excel files ?

2004-12-22 Thread John Holmes
;s the easiest way, IMO, because you can include styling along with it. ---John Holmes... UCCASS - PHP Survey System http://www.bigredspark.com/survey.html -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] PHP Classes to generate Excel files ?

2004-12-22 Thread John Holmes
ite a while. I don't if it's still being actively developed or kept up to date or what, though... ---John Holmes... UCCASS - PHP Survey System http://www.bigredspark.com/survey.html -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] query is not executing data is not entering in created database

2004-12-26 Thread John Holmes
t evaluates to FALSE, then nothing within the conditional block is executed? Your query is probably fine, but the code is just never getting to it. I could tell you to use $_GET['submit'] or $_REQUEST['submit'], but would you know why or where to use it? -- ---John Holmes.

Re: [PHP-DB] Undefined indicies

2004-12-26 Thread John Holmes
on']) && $_REQUEST['action'] == 'foo' ) do_something; Why "lord forbid"? This is how you should do it. I mean, since you do know what the issue is here, you could use the first method if you're afraid of isset() or something. I do it the seco

Re: [PHP-DB] check out this , if block is not executing ............

2004-12-27 Thread John Holmes
e data). I know that's a lot of info and we haven't even gotten into why your database query will probably fail eventually. Wherever you learned PHP didn't do a very good job or if you're learning it yourself, you need to spend some more time on the basics before getting this &q

Re: [PHP-DB] Getting total results

2004-12-28 Thread John Holmes
way around that, anyhow), but hopefully optimized better by MySQL. Perform your own tests, of course. See the documentation on FOUND_ROWS() at the following URL for more info: http://dev.mysql.com/doc/mysql/en/Information_functions.html -- ---John Holmes... Amazon Wishlist: www.amazon.com/o

Re: [PHP-DB] Getting total results

2004-12-28 Thread John Holmes
e question was about how to make two queries more efficient: SELECT ... FROM table WHERE ... LIMIT x,y SELECT COUNT(*) FROM table WHERE ... -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com -- PHP Databa

Re: [PHP-DB] Getting total results

2004-12-29 Thread John Holmes
ata units in it may not be more efficient than connecting to the database and just retrieving 10 data units at a time... -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com -- PHP Database Mai

Re: [PHP-DB] why is it so?

2004-12-30 Thread John Holmes
lines, etc). Sessions rely on cookies and the cookie must be set in the headers before any output. any_php_code(); session_start(); any_other_php_code(); ?> ... Also, this is better posted to [email protected] since it has nothing to do with databases. -- ---John Holmes... Am

Re: [PHP-DB] MySQL Auto PK

2005-01-05 Thread John Holmes
OOzy Pal wrote: Is it possible to have mysql at an ID as 20050105-1 as (MMDD-1), -2, etc. automatically? No. But you can always just use SELECT CONCAT(date_column,'-',pk_column) AS fixed_id ... if you _really_ need something like this. Or just join them together in PHP. -- ---J

Re: [PHP-DB] insert into mysql-db from csv-file

2005-01-17 Thread John Holmes
Ruprecht Helms wrote: I want to read a csv-file and import the datas into a mysql-db. How do I make this. A little scriptexaple in php would be helpfull. Why not just LOAD DATA INFILE from MySQL? No need to involve PHP at all, really... -- ---John Holmes... Amazon Wishlist: www.amazon.com/o

Re: [PHP-DB] Pulling Date from MySQL then subtract

2005-01-22 Thread John Holmes
... -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] last record

2005-01-24 Thread John Holmes
n a record set? Unless you're trying to recreate mysql_insert_id(), then the way you have written is the way to do it. I suppose you could use mysql_result(), but that'd be pretty inefficient. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect:

Re: [PHP-DB] IIS, PHP, and session data

2005-01-25 Thread John Holmes
ls off. That may be leading to the errors you see later. The question I have is: What concerns should I have with PHP sessions when I move from Apache to IIS? None if sessions are set up correctly on each machine and you're using the same version of PHP at the same error reporting level. -

Re: [PHP-DB] 'Order by' question

2005-02-09 Thread John Holmes
erly, so I get 34B, 34A, 34C etc etc. Is there a simple way for me to make it sort by number first and then by letter? Not in your query. Try resorting it using a natural sort in PHP. The A, B, and C should be in another column, anyhow. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/regi

  1   2   >