Re: [PHP-DB] replace question
Chris Payne wrote: Hi there everyone, I'm pulling some sensitive data from a MySQL DB with PHP and the clients wants the first x amount of numbers displayed on the screen to be xx etc ... rather than the numbers, but wants the last 6 to be displayed, is there an easy way to do this? I understand this isn't technically a DB question as such, but if someone could point me in the right direction (IE: which function to read up on) I would really appreciate it. Chris Well, it can technically be done in either the query itself or PHP, I prefer to do that sort of thing in the query. Using MySQL I woudl do somehting like: CONCAT('xx',RIGHT(sColumn,6)) I didn't verify the RIGHT function ,but that sort of thing should be possible with any sort of DB server. If I were doing it with PHP, it would be something like $sColumn = 'xx'.substr($sColumn,-6); Chris -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] replace question
Hi there everyone, I'm pulling some sensitive data from a MySQL DB with PHP and the clients wants the first x amount of numbers displayed on the screen to be xx etc ... rather than the numbers, but wants the last 6 to be displayed, is there an easy way to do this? I understand this isn't technically a DB question as such, but if someone could point me in the right direction (IE: which function to read up on) I would really appreciate it. Chris
[PHP-DB] Replace into
Hi! In mySql you can do: replace into tbl_name values(value_1, value_2) does it work for Oracle aswell? Can anybody provide me with a link to a GOOD Oracle syntax reference. Oracle needs serious help with their documentation...:-( Regards /Robert -- 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]
RE: [PHP-DB] 'replace' with 'where'
snip $result_insert = mysql_query(replace into wantlist where id = '$id' values ('', '$artist', '$title', '$tracks', '', '', '')); the $id is already defined in the url, by the way (ex. snip The way replace works is it looks for a unique index key in your update list, if it finds one it uses that key to determine where the REPLACE is done. The update command would probably work better for you if all you're wanting to do is change column values of a record already stored in the table. It's also much easier and versatile Sincerely, Craig Vincent -- 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]
RE: [PHP-DB] replace string - case insensitive
go to http://www.php.net/eregi_replace hth Dave -Original Message- From: J- E- N [mailto:[EMAIL PROTECTED]] Sent: 28 July 2001 15:41 To: [EMAIL PROTECTED] Subject: [PHP-DB] replace string - case insensitive hello str_replace is case sensitive, what function should i use for case insensitive. thanks very much. -- 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]