Re: [PHP-DB] Using PHP to import a DB
On 2005-11-06, Todd Cary [EMAIL PROTECTED] wrote: system(mysql -u user -p db /tmp/mydb); With the -p switch, the user is asked for the password. How does that happen with the system command? Don't leave a space between -p and the password mysql -u user -pyourpassword -h somehost db /tmp/mydb -- Met vriendelijke groeten, Tim Van Wassenhove http://timvw.madoka.be -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: mysql_fetch_assoc to ADOdb??
On 2005-09-08, Joshua Kramer [EMAIL PROTECTED] wrote: Hi all, I'm converting an application from Mysql native code to ADODB. Is there a simple way to get ADOdb's GetAssoc() function to behave exactly like mysel_fetch_assoc, where the array keys are field names instead of the key fields themselves? IE: What's wrong with: $db-setFetchMode(ADODB_FETCH_ASSOC); $rs = $db-Execute('...'); $rows = $rs-getRows(); -- Met vriendelijke groeten, Tim Van Wassenhove http://timvw.madoka.be -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: amp;
On 2005-08-27, Shay [EMAIL PROTECTED] wrote: Hi, I'm having trouble getting amp; to work properly. I start with a URL that has just tags. I use str_replace to replace the with amp;. Now this works with URLs that I print as hyperlinks, but the amp; does not print if I print the URL as a normal string. If I view the page source the amp; is there, but not on the page itself. Anyone know how to fix this? If you generate an URL you should use http://www.php.net/urlencode. If you want to insert that URL in a html page you should use http://www.php.net/htmlentities. -- Met vriendelijke groeten, Tim Van Wassenhove http://timvw.madoka.be -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Newbie needs help with multiple MySQL databases
In article [EMAIL PROTECTED], Matthew wrote: Hi, im fairly new to php and mysql and need a little help. im running a forum community and would like to have it run on multiple databases because of performance issues others have encountered using the same software on on database. My question is is it possible to have the software connect to 2 different databases depending on which is needed? With some database abstraction layer it seems quite easy to run all the select queries on a slave server, and do the update/insert/delete queries on the master server. -- Met vriendelijke groeten, Tim Van Wassenhove http://www.timvw.info -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Wait Statement... ?
In article [EMAIL PROTECTED], John W. Holmes wrote: Daevid Vincent wrote: Similarly, I could adjust my brute force attack to sleep() a pre-determined amount of time too ;-) Uhmmm.. how effective is a brute force attack where you can only try one combination per second? It's going to take you a while to get through that dictionary. You're mistaken here. Every kiddie knows he has to fork 50 concurrent threads that try to authenticate... I'd suggest to have 2 queues for failed authentication attempts. One containing (ip - timestamp) pairs, the other containing (username - timestamp) pairs. Every time someone tries to authenticate, you count the number of failures in both queues. The larger the number, the longer the sleep will take. (removing old entries once in a while might speed up things) -- Tim Van Wassenhove http://home.mysth.be/~timvw -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Easy reg expression problem
In article [EMAIL PROTECTED], Jason Wong wrote: On Friday 16 July 2004 08:05, Justin Patrin wrote: If you're simply trying to get '@email.com' then use strstr(). Of courseI'm just so used to pregs... Well the advantage of using a regex is that you can perform some form of validation on the address. And in the end compare your regular expression with the one at: http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html -- Tim Van Wassenhove http://home.mysth.be/~timvw -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Temporary table name
In article [EMAIL PROTECTED], Rosen wrote: Hi, I need to create temporary table in mysql. And I generate random name - i.e. TMP21567. How can I check is this name already exist in database ? SELECT COUNT(*) AS count FROM temporary_table WHERE name='TMP21567'; Probably you'll want to make the name the primary key or at least unique. This way you save yourself from adding duplicate entries with the same name. -- Tim Van Wassenhove http://home.mysth.be/~timvw -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re[2]: [PHP-DB] Table locking
In article [EMAIL PROTECTED], Emre Erdogan wrote: Hi... I want to say some words about the Table Locking problem. I had a problem something like this one, I find solution for this by locking only the item that will updated. I added two areas one that has a value 0 or 1 giving it is currently used by someone, and second time it is started to use, default 0. When someone trying to update the item, first area has the value 1 and the second has the current time. After update completes, ifrst has the value 0, and second also 0. I think one row will satisfy, namele a timestamp last_update. If you generate a form for the user to update the values of the current record, just add the timestamp as a hidden value. If the user submits the updated values compare the submitted last_update with the value in the database. If they are equal, perform the update (and change the value for last_update). If they are not equal, somebody else has changed the values in the meantime and the update should not be executed. If you are looking for other synchronization techniques you should have a look at the algorithms by Dekker and Peterson etc... Every website on computer algorithms will know how they work... -- Tim Van Wassenhove http://home.mysth.be/~timvw -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: LAST_INSERT_ID?????
In article [EMAIL PROTECTED], Scott V Nipp wrote: I am trying to pull the entry number to display for the user as a ticket number. I would assume that I should use the LAST_INSERT_ID function for this. Unfortunately, I am getting either failures or all zeroes for this output. I can't even get this function to work in a SQL query window. Please help!!! I would attach code to this, but I am not sure what to attach. Try SELECT LAST_INSERT_ID() AS id; -- Tim Van Wassenhove http://home.mysth.be/~timvw -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: Validate Value
In article [EMAIL PROTECTED], Rinku wrote: That's correct behaviour. The alphabet doesn't know what a space is ;) Thus append the other allowed characters to your a-zA-Z interval. Can you pls tell me how to add space in name ? If you reply under what is already written (and cut the irrelevant things out) , things stay clear for everybody. As i mentionned before, use your regular expressions manual. There you will find what \s and \w mean. -- Tim Van Wassenhove http://home.mysth.be/~timvw -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: Validate Value
In article [EMAIL PROTECTED], Rinku wrote: --0-1101702729-1089550436=:23431 Content-Type: text/plain; charset=us-ascii I have used this code. $pattern=/^\s+[a-zA-Z]+$/; if(preg_match($pattern,$_POST['name'])) { Statements; } But here still system not supporting for space. If you don't bother to read my advices, i don't bother to answer anymore. -- Tim Van Wassenhove http://home.mysth.be/~timvw -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Storing Date in mysql
In article [EMAIL PROTECTED], Michael Gale wrote: Hello, I need to store the date of record / entry in the mysql database, so I have the following table create statement: `token_date` varchar(100) NOT NULL default '', Why don't you use a date format that your database supports? If i'm not mistaken: timestamp, date, datetime... With from_unix function you can convert unix timestamps to mysql timestamps. And with date_format function you can format the timestamp to whatever you like. And you get some functions to calculatie differences between timestamps etc... -- Tim Van Wassenhove http://home.mysth.be/~timvw -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php