Re: [PHP-DB] How to know the name of a function ?

2008-11-09 Thread Stut
to $0 (bash) in php ? The constant __FUNCTION__ will give you this. -Stut -- http://stut.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] mysql_select_db

2008-10-20 Thread Stut
missions when it comes from a different subnet. Check the MySQL manual for detailed info on permissions. -Stut -- http://stut.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Timestamps

2008-04-30 Thread Stut
7; where Record='1'"; Simple right? Not quite...in my database it's storing a "0" in the timestamp field which is a int(10) field. I have googled, and searched manuals, but have not been able to figure out what is going on Any Ideas? timestamp is a reser

Re: [PHP-DB] Resource id #5

2008-03-27 Thread Stut
print a resource you get the text "Resource id #n" where n is replaced with its ID. To make use of this resource you need to use functions like mysql_fetch_array, mysql_fetch_assoc or one of the many others detailed in, you guessed it, the manual. Try it, you might like it. -Stut

Re: [PHP-DB] SELECT query with multiple "WHERE" Clause

2008-02-27 Thread Stut
working try entering ';delete * from gig;select * from gig where Name=' (including quotes) into the gig_name form field. When you get over the loss of all your data go read about sanitising your input: http://php.net/mysql_real_escape_string -Stut -- http://stut.net/ I am creatin

Re: [PHP-DB] How to recognize which 'case' is being echoed by switch statement

2008-02-22 Thread Stut
d to use == to do that. I would suggest you buy a book on PHP for beginners, or Google for an introductory tutorial because these are pretty basic syntax mistakes. -Stut -- http://stut.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] About mysql_connect()

2008-02-06 Thread Stut
On 6 Feb 2008, at 14:45, js wrote: Use PDO and try/catch. I think it's much easier. Easier than checking the return value for FALSE? OP: The manual is your friend, it tells you exactly how to detect failures from any function. http://php.net/mysql_connect -Stut -- http://stut.net

Re: [PHP-DB] String comparision issue with change of databases

2007-11-23 Thread Stut
ssue there. You're using === which does a type *and* value comparison. I'm guessing that the MySQL driver does the conversion to an integer, whereas the PostgreSQL driver doesn't. Change it to == and it'll work just fine. -Stut -- http://stut.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Phpmailer sending duplicate messages...

2007-11-01 Thread Stut
ail->Send()) { echo 'Message was not sent.'; echo 'Mailer error: ' . $mail->ErrorInfo; } else { echo 'Message has been sent.'; } } You're re-using the same message each time around the loop. Each time you call AddAddress you're, erm, adding

Re: [PHP-DB] Trouble with Text Area

2007-10-31 Thread Stut
to format this would be greatly appreciated. The mySQL db column TYPE I am calling is Blob not null. -Stut -- http://stut.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] How can i test it?

2007-08-16 Thread Stut
ff, but I don't think that's likely to help you. It sounds to me like you want hand-holding through the development process. I can do that but I'd expect to be paid market rates!! There are lots of resources around this area all over the Internet. I suggest you use Google to

Re: [PHP-DB] How can i setup a server to run a socket programme

2007-08-16 Thread Stut
with PHP. I suggest you find a beginners guide to the OS you're using and do some research on how to run a daemon. -Stut -- http://stut.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] use of str_split

2007-08-09 Thread Stut
is a string'; $certainlength = 5; $pos = 0; $stringlen = strlen($string); $array = array(); while ($pos < $stringlen) { $array[] = substr($string, $pos, $certainlength); $pos += $certainlength; } // $array now contains an element for every $certainlength characters // in $

Re: [PHP-DB] connection id mystery

2007-07-26 Thread Stut
code with get_lock() and release_lock(), to make it quasi-atomic. Thanks for the suggestion, and thanks to Charles Morris as well for his response. No problem, but please include the list when replying in future. -Stut -- http://stut.net/ -- PHP Database Mailing List (http://www.php.net/) To

Re: [PHP-DB] connection id mystery

2007-07-25 Thread Stut
pure SQL solution, but it will work. You may also want to add a timestamp row to allow for a timeout on the lock. -Stut -- http://stut.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Slooooow query in MySQL.

2007-07-23 Thread Stut
Stut wrote: Chris wrote: Stut wrote: Chris wrote: Rob Adams wrote: I have a query that I run using mysql that returns about 60,000 plus rows. It's been so large that I've just been testing it with a limit 0, 1 (ten thousand) on the query. That used to take about 10 minu

Re: [PHP-DB] Slooooow query in MySQL.

2007-07-23 Thread Stut
Chris wrote: Stut wrote: Chris wrote: Rob Adams wrote: I have a query that I run using mysql that returns about 60,000 plus rows. It's been so large that I've just been testing it with a limit 0, 1 (ten thousand) on the query. That used to take about 10 minutes to run,

Re: [PHP-DB] Slooooow query in MySQL.

2007-07-20 Thread Stut
elds you need. You may also want to look into changing the cursor type you're using although I'm not sure if that's possible with MySQL nevermind how to do it. -Stut -- http://stut.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] sql statement - complex order by

2007-07-02 Thread Stut
ist out all the products, ordered by title but listing out all the Cats products first. Any way to do that without having separate statements? Thanks... select * from productgroup where groupid = $productid order by (label = 'Cats') desc, title And I do hope you're properly va

Re: [PHP-DB] Problem with passing variable to mssql

2007-06-28 Thread Stut
are no errors and you are still getting different results from the script and from QA with the same SQL statement then by definition something *is* different. -Stut -- http://stut.net/ >>> Stut <[EMAIL PROTECTED]> 6/28/2007 8:30 AM >>> William Curry wrote: > I have iss

Re: [PHP-DB] Problem with passing variable to mssql

2007-06-28 Thread Stut
the contents of $variable? If so that's never going to work. Try this instead... "SELECT * FROM tblX where value like '".str_replace("'", "''", $variable)."%' " -Stut -- http://stut.net/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Creating all key combinations passwords

2007-05-20 Thread Stut
e highly appreciate. The only reason I can see to do such a thing is to build a brute-force password cracker, and seeing as you're not smart enough to realise that you can do so incrementally instead of randomly, I don't see much reason to help you. Enjoy. -Stut -- PHP Database Mai

Re: [PHP-DB] Extracting data from Arrays in ISAM table

2007-05-20 Thread Stut
cords, do the following... foreach (explode(',', $single_result['name']) as $name) $arr_all_names[$name] = 1; Then after the loop, to get an array of the names... $arr_all_names = array_keys($arr_all_names); -Stut -- PHP Database Mailing List (http://www.php.net/) To

[PHP-DB] Re: [PHP-WIN] automatic-click flash?

2007-05-06 Thread Stut
bedul wrote: nope.. that's can be dangerous since some activeX today are a food for a worm.. be safe on NET It has absolutely nothing to do with security. It's all about patents... http://channel9.msdn.com/ShowPost.aspx?PageIndex=2&PostID=169255 Fight the FUD. -Stut

Re: [PHP-DB] querying results from postgresql

2007-04-27 Thread Stut
ot receiving what it expects either. Does anyone see what I'm not doing right here? Just because the query returned a resource ID does not mean it contains any results. An empty result set is what you're getting, and you need to check for that before trying to use the results.

[PHP-DB] Re: [PHP] slow performance

2007-04-25 Thread Stut
Java version. I already installed an php-accelerator (eAccelator) which increased the overall performance, but still the performance is quite poor. Are there any "tweaks" to tune PHP performance? Don't use Windows. If you *must* use windows, use FastCGI. -Stut -- PHP Database

Re: [PHP-DB] database password

2007-04-03 Thread Stut
g the doors rather than putting 5-minute obstacles in the path. -Stut -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Accessing Oracle

2007-03-21 Thread Stut
an offering in this area: http://www.zend.com/products/zend_core/zend_core_for_oracle -Stut -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] help with mysql connect error

2007-02-08 Thread Stut
HP5 can be built against libs for MySQL 4 or 5, so just make sure that you match the version used for PHP to the server version and you'll be fine. Thanks for your help, Stut!!! No probs. -Stut -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] help with mysql connect error

2007-02-08 Thread Stut
have a MySQL 4 client in there? If that is the case, how should I rebuild PHP? Yes, and it depends on what OS, where it originally came from, etc. The alternative is to change the password of the MySQL user you're using - the link in my last post explains how to do this. -Stut -

Re: [PHP-DB] help with mysql connect error

2007-02-08 Thread Stut
eturning to PHP after 5 years of not writing in it. This basically means that you're trying to access a MySQL 5 server with MySQL 4 client. You have two choices... 1) Rebuild PHP with the MySQL 5 client libs 2) Use the old password mechanism in MySQL See here for more info... http:/

Re: [PHP-DB] help with mysql connect error

2007-02-08 Thread Stut
Tim McGeary wrote: Please include the list in replies. Sorry, I meant to, but hit the wrong button. Tim McGeary wrote: Stut wrote: Tim McGeary wrote: I am new to this list today, so if I should be sending this to another specific PHP list, please let me know. I am getting the following

Re: [PHP-DB] help with mysql connect error

2007-02-08 Thread Stut
s the user that Apache (or whatever web server you're using) runs as have access to mysql.sock? -Stut -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Am I missing something?

2007-01-28 Thread Stut
e following and adapt what the book is giving you to work without it. Reasons for not enabling register_globals are also given on this page... http://php.net/register_globals -Stut -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] textarea value assignment

2006-10-04 Thread Stut
" rows="1" name="problem_eb" >?> Also worth mentioning that you may run into problems if you don't use htmlentities on $problem_val, like so... cols="1" rows="1" name="problem_eb" >htmlentities($problem_val); ?> -Stut -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Php 5 and Mysql on Windows

2006-10-03 Thread Stut
bution that need to be on the path for MySQL to function. You may also want to check that where you've put php.ini is where PHP is expecting it to be. A phpinfo() page will tell you that. -Stut -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Php 5 and Mysql on Windows

2006-10-03 Thread Stut
() in Test.php on line 3" is returned. > > $conn = mysql_connect('localhost', 'root', 'password') Installing MySQL is not enough - you need to enable the mysql extension in your php.ini. -Stut -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] user directory from a form

2006-10-01 Thread Stut
ame itself is sent. -Stut -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] ViewSonic VX724

2006-09-19 Thread Stut
On Tue, 19 Sep 2006 03:30:24 +0100, Ron Piggott (PHP) <[EMAIL PROTECTED]> wrote: I realized this is off topic; I am not sure where I would look online. Off topic? It's not even in the same continent!! Try a Linux mailing list - that's what they're there for!! -

Re: [PHP-DB] Direct Access to an Array Item?

2006-08-09 Thread Stut
e of a function to a variable if you want to access it as an array. -Stut -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Re: making an array from data in textfile

2006-07-23 Thread Stut
it that way is that each element of the array will have a newline on the end. Maybe this is what you want, but I doubt it. - -Stut -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEw3tl2WdB7L+YMm4RA

Re: [PHP-DB] Re: making an array from data in textfile

2006-07-23 Thread Stut
's a numeric array, I shouldn't need quotes around the ip octets. > OK, well I did a debug and this is whats coming out: > > Array > ( >[0] => 127.0.0.1,127.0.0.1,127.0.0.1 > ) PHP doesn't know what separates each element of the array, so you need to tel

Re: [PHP-DB] Using MAX with COUNT?

2006-07-23 Thread Stut
nction" error. > > Anyone think of another way to do this in a single SQL statement, or > some other simple method? select boroughID, count(*) as thecount from bsp_area group by boroughID order by thecount desc limit 1 - -Stut -BEGIN PGP SIGNATURE- Version: GnuPG

Re: [PHP-DB] Submitting form from

2006-07-17 Thread Stut
or in cookies they should all be subjected to the same validation. Trust nothing. -Stut -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] detecting negative numbers

2006-07-16 Thread Stut
sibility that someone who couldn't figure that out is writing PHP code scares me. You might want to think about Googling for an absolute beginners guide to programming before continuing. - -Stut -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Usi

Re: [PHP-DB] need help on setting up tables for db (NFL Football)

2006-07-05 Thread Stut
, AIM, or MSN. http://www.theufl.com/ufl_project.htm Your help would be greatly appreciated. I would be using phpmyadim for this. Sure. How much do you pay? -Stut -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Generating forms and form elements

2006-06-20 Thread Stut
Micah Stevens wrote: Stut wrote: Bastien Koert wrote: Not commenting on the appropriateness or security of the eval function. Merely offering a possible path. It is up to the OP to decide if that solution is the correct one. I would accept that if you'd mentioned, or at least hinted a

Re: [PHP-DB] Generating forms and form elements

2006-06-20 Thread Stut
essed when using eval. You didn't so I thought it needed to be pointed out. I think we, as a community, have a responsibility to point out the potential security and stability pitfalls of the possible solutions we provide. But that's just me. -Stut -- PHP Database Mailing List (htt

Re: [PHP-DB] Generating forms and form elements

2006-06-20 Thread Stut
're doing (and there almost always is), do that instead. In this case a description of the form would be a better thing to store in the DB rather than the code to generate it. -Stut [1] Rasmus, a while back, can't recall when, but it stuck in my mind Bastien From: "Ba

Re: [PHP-DB] How can I get in PHP the number of files in a directory

2006-05-31 Thread Stut
suad wrote: This is for reading a file: How can I get in PHP the number of files in the directory (rasmus) and the files names in a loop? http://php.net/glob or http://php.net/readdir -Stut -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net

Re: [PHP-DB] Processing a web form / loop etc.

2006-05-30 Thread Stut
($num = 1; $num <= 3; $num++) { $varname = 'suggested_category_'.$num; $val = $$varname; // Stick your code here replacing references to the $suggested_category_1 var with $val } Incidentally, I do hope that code was simplified for brevity. There should be extensive use of

Re: [PHP-DB] mysql searching with fulltext indexing

2006-05-24 Thread Stut
Bevan Christians wrote: Is there any to query a mysql table to get it to return the field names that it currently has marked as Fulltext Indexes? |SHOW COLUMNS FROM sometable -Stut | -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Date Conversion in RFC822 format

2006-05-18 Thread Stut
rest of that page. -Stut -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Re: Sending filing attachments using PHP

2006-05-12 Thread Stut
other API (C, Python, Ruby, *anything*) to MySQL that is consistently easier to setup and use Again, we'll have to agree to disagree. For me PHP makes setting up and using MySQL a breeze. Anyway, I think we should end this here since we're clearly not making a dent in each others opinion of PHP. Feel free to reply to me offlist if you really want to continue, but I don't think there would be much point. -Stut -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Re: Sending filing attachments using PHP

2006-05-12 Thread Stut
JupiterHost.Net wrote: Stut wrote: What planet are you on? Seriously? Because PEAR does not need to be compiled into PHP. Zend Optimizer is no different to the optimizers I was referring to --with-pear, sorry "compiled" was not the right word * I'm not familiar with the

Re: [PHP-DB] Re: Sending filing attachments using PHP

2006-05-12 Thread Stut
in the spirit it is meant, but please answer me this. What has PHP done to you? Why are you so anti-PHP? And specifically why are you on a PHP list suggesting people use a different technology? -Stut -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Re: Sending filing attachments using PHP

2006-05-12 Thread Stut
stopping you installing any of the PEAR classes as a regular user and using it yourself. What could be easier? Not having to read your ignorant emails. -Stut -- If ignorance is bliss, you must be in heaven! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Sending filing attachments using PHP

2006-05-12 Thread Stut
favour and unsubscribe from this list, or at the very least please stop posting pointless and time-wasting answers. -Stut -- If ignorance is bliss, you must be in heaven! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] access db

2006-05-07 Thread Stut
://php.net/mysql. Google tends to be very good too: http://www.google.co.uk/search?q=php+access+database -Stut -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Newly inserted record ID

2006-04-30 Thread Stut
xperienced programmers say things like Stut has said below because they tend to intimiate inexperienced coders, make them shy away from asking questions out of fear that gurus like Stut will say the kinds of things he has said below. For this reason I'm going to unsubscribe from the list, lest I

Re: [PHP-DB] Newly inserted record ID

2006-04-30 Thread Stut
tions here! -Stut -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Session Variable from Recordset

2006-04-30 Thread Stut
ss of others." -- Jules Renard Say no more! -Stut -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Single quotes in INSERT statements?

2006-04-25 Thread Stut
nstead of single - that's what real_escape_string was designed to escape. Alternatively use str_replace to escape single quotes. -Stut -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] apostrophes everywhere

2006-02-20 Thread Stut
ity as the later it should would for my purposes. Just to clarify, my suggestion was mysql_real_escape_string, not mysqli_real_escape_string. The former is available on PHP4 >= 4.3.0 and PHP5. That's the function the link I posted goes to (http://php.net/mysql_real_escape_string). -Stu

Re: [PHP-DB] apostrophes everywhere

2006-02-18 Thread Stut
ks fine all the time, but on the production server I'm running PHP 4.3.11 and MySQL 4.1.12 that's where i'm having problems with the apostrophe. RTFM: http://php.net/mysql_real_escape_string and http://php.net/magic_quotes -Stut -- PHP Database Mailing List (http://www.php.net

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

2004-09-01 Thread Stut
Trying Should be... 1 Trying > > Prob 2: Before the above error started, The > > following > > section was not creating 10 rows. > > > > > > > for ($i=0; $i <$count; $i++): ?> The should

Re: [PHP-DB] Read a PDF file via PHP

2004-06-25 Thread Stut
of the file? I do this on one of my sites using a utility called pstotext. Find it at http://research.compaq.com/SRC/virtualpaper/pstotext.html -- Stut -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php