Re: [PHP-DB] No MySQL Support in PHP5 - Uh oh!

2003-07-04 Thread Marco Tabini
Try in the current snapshot at http://snaps.php.net (also, more info on my blog). Cheers, Marco Tabini http://blogs.phparch.com On Fri, 2003-07-04 at 13:01, Adam Lundrigan wrote: > that doesn't seem to workit tells me that the libmysql.dll file is not a > PHP module. Where

Re: [PHP-DB] No MySQL Support in PHP5 - Uh oh!

2003-06-29 Thread Marco Tabini
Sorry then, the library. The purpose was not to confuse, but, of course, to inform. Marco On Sun, 2003-06-29 at 21:39, Rasmus Lerdorf wrote: > On Sun, 29 Jun 2003, Marco Tabini wrote: > > The MySQL extension has been debundled because MySQL has changed its > > licensing policy

Re: [PHP-DB] No MySQL Support in PHP5 - Uh oh!

2003-06-29 Thread Marco Tabini
ense, and I am assuming it was the change > to the "MySQL drivers" needing a commercial license to be used that is > causing all of the fuss? > > Correct me if I'm wrong, just trying to figure out what's going to > happen to some legacy stuff when 5 hits the fan!

Re: [PHP-DB] checking a string for numbers

2003-06-26 Thread Marco Tabini
On Thu, 2003-06-26 at 08:09, CPT John W. Holmes wrote: > if(preg_match('/[0-9]/',$myVar)) Same thing, fewer characters: if (preg_match('/\d/', $myVar)) Marco -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP-DB] md5 question!

2003-06-24 Thread Marco Tabini
ey lose > > > them via email. > > > > No, you can't. You'll need to generate a new password, md5 > > it, store it > > & mark it expired, timestamp it so it's only valid for, say, > > 30 minutes, > > email it, and finally, force th

Re: [PHP-DB] md5 question!

2003-06-24 Thread Marco Tabini
d5 being broken, although it's been claimed that it is breakable. I'd love to see the references they have sent you! Cheers, Marco > > Thanks everyone for your help/feedback/ideas and code > on this subject, it's been overwhelming. Very much > appreciated. > > Je

Re: [PHP-DB] md5 question!

2003-06-24 Thread Marco Tabini
On Tue, 2003-06-24 at 09:36, JeRRy wrote: > Hi, > > Hmmm okay... So if the passowrd was. > [snip] There are ways to avoid this. Typically, you can add a random token (or a salt) to the password before you calculate its checksum. This way, two users with the same password will have two different

Re: [PHP-DB] md5 question!

2003-06-24 Thread Marco Tabini
me try us out at http://www.phparch.com and get a free trial issue > > > Jerry > > --- Marco Tabini <[EMAIL PROTECTED]> wrote: > Hi > Jerry-- > > > > No, md5 is a one-way hash. That's why it's so > > safe--because if someone > > steal

Re: [PHP-DB] md5 question!

2003-06-24 Thread Marco Tabini
password? Is there a way for me to decode the > 32bit to plain text? > > Jerry > > http://mobile.yahoo.com.au - Yahoo! Mobile > - Check & compose your email via SMS on your Telstra or Vodafone mobile. -- Marco Tabini President Marco Tabini & Associates, Inc. 28 Bombay

Re: [PHP-DB] mysql wildcard

2003-01-08 Thread Marco Tabini
You probably want something like: select * from offtime where type like '{$type}%' As a side note, are you making sure that $type does not contain any malicious code? Cheers, Marco -- php|architect - The Monthly Magazine for PHP Professionals Come check us out on the web at h

RE: [PHP-DB] How to Make a Pop Up Window and show there a mysqltable for help input data?

2002-12-30 Thread Marco Tabini
I think you might be referring to data binding, which I think is only offered by Internet Explorer. A more browser-independent way is to use floating iframes that you can refresh depending on where the user has clicked. The iframe can point to a PHP script that extracts the data for you as needed.

Re: [PHP-DB] Querying two tables

2002-12-14 Thread Marco Tabini
Hello Cesar-- Your database design is not normalized, so you're going to have to cheat a bit--try this (I'm doing it from memory, so it might not work on the first try): select distinct Relationships.Subcatid, Subcategories.* from Relationships Inner Join Subcategories On Catid = '0001' and Relat

Re: [PHP-DB] OpenSSL, PHP and MySQL

2002-12-14 Thread Marco Tabini
I usually build an SSH tunnel whenever I need to connect securely to a remote MySQL server. There's a tutorial on how to do that here: http://www.netsys.com/cgi-bin/display_article.cgi?908 Marco -- php|architect - The Magazine for PHP Professionals The monthly magazine dedicated to

Re: [PHP-DB] Converting Databases

2002-12-01 Thread Marco Tabini
Simple solution, if you only have one or two tables: dump them in comma delimited format and then use the LOAD command from the MySQL shell frontend. Alternative: use the MySQL ODBC component and export from access to that (it works like a charm if you use the latest version). Either way should m

Re: [PHP-DB] Database Connections

2002-11-29 Thread Marco Tabini
I think that generally PHP closes any non-persistent connections for you when you leave your script, so that it's not necessary to clean up after your script is done. You can create persistent connections, but in a high-traffic site they tend to become a resource problem after a while--and your se

Re: [PHP-DB] Session questions

2002-11-27 Thread Marco Tabini
Here's a couple of suggestions: 1) You can use javascript to trap the window's closure and create a new window that simply calls one of your scripts that closes the session. This is not 100% foolproof, however, so you need to come up with a backup plan, like closing sessions automatically with a b

Re: [PHP-DB] Really dumb question... deleting everything but newest100 rows?

2002-11-23 Thread Marco Tabini
gt; > Back > ><http://www.ecritters.biz/PhpMyAdmin/db_details.php?lang=en&server=1&db=chizzy_co_uk&show_query=y&sql_query=delete+from+%60topics%60+order+by+id+desc+limit+100%2C+-1> > > Marco Tabini wrote: > > >If you have a column that gives you the &q

Re: [PHP-DB] Really dumb question... deleting everything but newest100 rows?

2002-11-23 Thread Marco Tabini
If you have a column that gives you the "newness" of each row--I'm assuming a date here: delete from my_table order by date_inserted desc limit 100, -1 This should work... I recommend a db backup first :-) Marco php|architect - The magazine for PHP Professionals The monthly world

Re: [PHP-DB] -- table name prefix in result set after join --

2002-11-23 Thread Marco Tabini
It really depends on the DBMS you are using, but you can use aliases as a trick to solve this problem: select a.col1 as a_col1, b.col1 as b_col1 from a join b on a.id=b.id This will return the two columns a_col1 and b_col1 Cheers, Marco -- php|architect - The magazine for PHP Pr

Re: [PHP-DB] Select Last row

2002-11-20 Thread Marco Tabini
Can you reverse your sorting order? In that case, the last row now becomes the first--making things much easier and faster! :-) Marco -- php|architect - The magazine for PHP Professionals The monthly worldwide magazine dedicated to PHP programmers Come visit us at http://www.phparc

RE: [PHP-DB] Query Executes in MySQL Command Line, Not From PHP.

2002-11-15 Thread Marco Tabini
query($sql_element_low) or die(mysql_error()); but it does not return an error. That's why I'm so baffled here. Everything SEEMS to be right. > -Original Message- > From: Marco Tabini [mailto:marcot@;inicode.com] > Sent: Friday, November 15, 2002 3:52 PM > To: Hutchins, Ri

Re: [PHP-DB] Query Executes in MySQL Command Line, Not From PHP.

2002-11-15 Thread Marco Tabini
I don't think you can have column names that start with a number. Are you sure you didn't mean to write: $sql_element_low = "UPDATE $table SET medialow=NULL WHERE ".$table."contentID=".$_POST["id"].""; Otherwise, try adding a simple die (mysql_error()); after the offending line and see what PH

Re: [PHP-DB] storing(/retrieving) HTML from textbox fields

2002-11-14 Thread Marco Tabini
Hi Gavin, Have you tried escaping your input? Take a look at the following: http://ca.php.net/manual/en/function.mysql-real-escape-string.php It should help you take care of the problem. Marco -- php|architect - The magazine for PHP Professionals The first monthly worldwide maga

Re: [PHP-DB] Arrays again again

2002-11-13 Thread Marco Tabini
Perhaps I don't understand what it is you're looking for, but... $a = array(); for ($i = 0; $i < $maxvalue; $i++) { $a[$year] = $value; } but this is almost too simple, which probably just means I didn't quite understand your question. Marco -- php|architect - The magazine

Re: [PHP-DB] how to put all rows into an array

2002-11-13 Thread Marco Tabini
while ($a[] = mysql_fetch_row ($rs)); should work Marco -- php|architect - The magazine for PHP Professionals The monthly worldwide magazine dedicated to PHP programmers Come visit us at http://www.phparch.com! On Wed, 2002-11-13 at 19:27, John A DAVIS wrote: > Is there anyway t

Re: [PHP-DB] date()

2002-11-13 Thread Marco Tabini
If you don't want to change your SQL statement: echo date ('Y/m/d', strtotime ($myrow['datefield'])); Marco -- php|architect - The magazine for PHP Professionals The first monthly worldwide magazine dedicated to PHP programmers Come visit us at http://www.phparch.com! --- Begin M

Re: [PHP-DB] MySql Update.

2002-11-12 Thread Marco Tabini
How about: function do_query ($table, $fields, $where) { $sql = 'update ' . $table . ' Set '; foreach ($fields as $k=>$v) $sql = $k . ' = \'' . $v . '\','; return mysql_query ($sql); } Not sure if it adapts 100% to your case but you can probably fix it up..

Re: [PHP-DB] Extracting column names from a db

2002-11-10 Thread Marco Tabini
The problem is that you're fetching a single row and then print out the result, whereas Mysql returns a row for each field. Try something like this: mysql_select_db("filterseveuk") or die(mysql_error()); $query = "SHOW COLUMNS FROM " .$table. ""; $result = mysql_query ( $query ) or die( mysql_

Re: [PHP-DB] Email and HTML Parser Library

2002-11-09 Thread Marco Tabini
Have you considered using the IMAP extension? That would solve pretty much all your problems with regards to "interpreting" the contents of a message. It's a bit slow, though. As for searching the hrefs and imgs, you can easily get away with a couple of regular expressions. Hope this helps. Mar

Re: [PHP-DB] Search and Replace

2002-11-08 Thread Marco Tabini
It should be fairly easy. Write a php script that loads your source file in memory and then substitute your values, then save it to disk. There was a thread between Jonathan Sharp and myself in the PHP mailing a week or so ago--if you check the archives you should find it pretty easily--Jonathan's

RE: [PHP-DB] Order DB through url toggle

2002-11-08 Thread Marco Tabini
I think you might be missing a = sign in your if statement. Marco - php|architect -- The Monthly Magazine For PHP Professionals Come visit us on the web at http://www.phparch.com! On Fri, 2002-11-08 at 11:26, Paul Ihrig wrote: > well i tried that.. > > but it out puts the right nu

Re: [PHP-DB] indexing on existing DB

2002-11-08 Thread Marco Tabini
Except when you have a million records, which may take a few seconds to build. :-) Marco - php|architect -- The Monthly Magazine For PHP Professionals Come visit us on the web at http://www.phparch.com! On Fri, 2002-11-08 at 11:12, Maxim Maletsky wrote: > > Index is always re-index

Re: [PHP-DB] Order DB through url toggle

2002-11-08 Thread Marco Tabini
Let's see: Last Name This is the general idea. $dir will toggle between 1 and 0. There are more "compact" ways of writing this--but this one should be clearer. Marco - php|architect -- The Monthly Magazine For PHP Professionals Come visit us on the web at http://www.phparch.com!

Re: [PHP-DB] textarea!!

2002-11-08 Thread Marco Tabini
You need to use nl2br http://ca.php.net/manual/en/function.nl2br.php Marco - php|architect -- The Monthly Magazine For PHP Professionals Come visit us on the web at http://www.phparch.com! On Fri, 2002-11-08 at 09:30, Siamak Sadeghianfar wrote: > Hi > I've written a guestbook in ph

Re: [PHP-DB] Argh!!!! Help with something o-f-f-t-o-p-i-c

2002-11-07 Thread Marco Tabini
Can you not filter the checkboxes by name? Just add one more condition to the if statement: if (el.type == 'checkbox' && el.checked && el.name != 'theothercheckbox') etc. Marco -- php|architect - The magazine for PHP Professionals The first monthly worldwide magazine dedicated to

Re: [PHP-DB] calling sql script

2002-11-07 Thread Marco Tabini
You can use exec http://ca.php.net/manual/en/ref.exec.php You will probably need to call the mysql shell like so: /path_to_mysql/mysql -u user -p password [-h host] -D database -e \\. filename Marco -- php|architect - The magazine for PHP Professionals The first monthly worldwide

Re: [PHP-DB] Record IDs: Numeric or String??

2002-11-06 Thread Marco Tabini
Numeric IDs are probably a bit faster--although if properly indexed not by much--plus you can use self-numbering columns with them. Marco -- php|architect - The magazine for PHP Professionals The first monthly worldwide magazine dedicated to PHP programmer Come visit us at http://

RE: [PHP-DB] MySQL password protection?

2002-11-06 Thread Marco Tabini
Make sure that the encoder you use actually makes string unreadable. Otherwise, you can use a simple trick, like for example XORing the whole string with FF or something similar. -- php|architect - The magazine for PHP Professionals The first monthly worldwide magazine dedicated to P

Re: [PHP-DB] Question

2002-11-06 Thread Marco Tabini
Well, you can already do that--just download and install the CGI version. Unless, of course, you meant that you want to write Windows GUI applications, in which case I think someone is working on something like that with PHP-GTK. Oh, the attachments are either quoted messages or patches, for the

Re: [PHP-DB] sort by date

2002-11-06 Thread Marco Tabini
To: "Snijders, Mark" <[EMAIL PROTECTED]>, "'Marco Tabini'" , "Terry Romine" <[EMAIL PROTECTED]> [EMAIL PROTECTED]>cc: <[EMAIL PROTECTED]>

RE: [PHP-DB] sort by date

2002-11-06 Thread Marco Tabini
ne for PHP Professionals The first monthly worldwide magazine dedicated to PHP programmer Come visit us at http://www.phparch.com! --- Begin Message --- why does everybody always gives the answers?? why not a hint, or where to search that they can learn something about it??? -Original Message----- F

Re: [PHP-DB] sort by date

2002-11-06 Thread Marco Tabini
Ok, going out on a limb here... have you tried something like select e.id, title, location, address, contact, category, event_time, urllink, descript, min(event_date) from eventTable e inner join dateTable d on e.id = d.id group by e.id ? Marco -- php|architect - The magazine for

Re: [PHP-DB] mail()

2002-10-31 Thread Marco Tabini
Did you restart the server? Are you sure you modified the right php.ini? On Thu, 2002-10-31 at 14:53, Edward Peloke wrote: > I know this is off topic to the db list but.. > > > I am attempting to use the mail function. I have set the smtp in the > php.ini file to my smtp server but when I run

RE: [PHP-DB] PHP/MySQL and passing url params

2002-10-27 Thread Marco Tabini
the rowRsId variable is never defined... that's why PHP is complaining. On Sun, 2002-10-27 at 19:53, alex hogan wrote: > Sorry..., my bad. Too wrapped up in the problem. > > > > Notice: Undefined variable: row_rsID in > D:\web\hogana\demo\login\TMPbl2tw4o24u.php on line 48 > > Warning: Canno

Re: [PHP-DB] PHP/MySQL and passing url params

2002-10-27 Thread Marco Tabini
What's on line 48? On Sun, 2002-10-27 at 18:43, alex hogan wrote: > Hi All, > > I am new to the list, as a matter of fact this is my first post so if > I'm covering territory that has been already covered please excuse me. > > I am using PHP/MySQL/Dreamweaver MX. I expect the razzing to start

Re: [PHP-DB] Number Conversion

2002-10-18 Thread Marco Tabini
number_format(): http://ca.php.net/manual/en/function.number-format.php On Thu, 2002-10-17 at 14:52, Manoj Japher wrote: > hi, > I would like to format my output. I would like to represent my > integer outputs as 2,000 instead of 2000 which it prints by > default. > > For e.g. I want 200

Re: [PHP-DB] Birthdays!

2002-10-14 Thread Marco Tabini
How about select * from table where birthday between now() and date_add(now(), interval 15 day); Assuming, of course, you're using MySQL. Cheers, Marco On Mon, 2002-10-14 at 16:20, Steve Vernon wrote: > Hiya, > Just wondering what is the best way to do this please. > > I have v

Re: [PHP-DB] more upload script filename checking

2002-10-14 Thread Marco Tabini
Well, you can use the break statement to exit a loop or code block, but wouldn't you rather want to create a single loop that can handle any number of files? On Mon, 2002-10-14 at 13:54, Michael Knauf/Niles wrote: > > Ok, next question: > > Here's my upload script: > >if ($upfile1=="

Re: [PHP-DB] .htaccess and db authentication

2002-10-14 Thread Marco Tabini
How about using PHP as a pipe to funnel the MPG files through: This way you can place your MPG files completely outside the server root and your users will have to go through your scripts in order to even get to them. Even better, they won't be able to bookmark them because even if they do they

Re: [PHP-DB] First record of array not being echoed

2002-10-14 Thread Marco Tabini
It seems to me that the first time you go through the loop, if $record->wave_num is != $prior_wave then you print the wave number but not the person's name--but you already have a record there with a person's name! Try taking out the else statement--if you follow the code from there you should be

Re: [PHP-DB] results of query

2002-10-07 Thread Marco Tabini
Will this work (assume you're using mysql): function printresult ($rs) { if ($a = mysql_fetch_assoc($rs)) { // Print header echo ''; foreach (array_keys ($a) as $v) echo '' . $v . ''; echo

RE: [PHP-DB] passing array to next page

2002-10-06 Thread Marco Tabini
Also, if you decide to use serialize() and unserialize() through the post variables (I'd recommend against using it in the query URL because some browsers have a limit as to how much data they can fit into it), you should consider encrypting it in some way or at least appending an encrypted CRC to

Re: [PHP-DB] $_POST And $_REQUEST

2002-10-06 Thread Marco Tabini
>$_REQUEST is an associative array consisting of the contents of $_GET, >$_POST, $_COOKIE, and $_FILES Also, they are not function but arrays, as Hatem said. You can usa $_REQUEST as a "catch-all" that provides you with both what was passed to your page through the URL query ($_GET) and what was