query help

2012-07-31 Thread Haluk Karamete
I've got a text field called source_recid. It stores half string half number like strings in it. Example shop.orders.32442 the syntax is DATABASENAME.TABLENAME.RECID My goal is to scan this col and find out the biggest RECID ( the integer) in it. So, in a case like this shop.orders.32442 shop

distinct & count operation with the use of "where count > $num"

2012-06-17 Thread Haluk Karamete
Hi, I'm trying to get this work; SELECT distinct `term`,count(*) as count FROM blp_sql_distinct_temp_table where count >= 5 group by `term` order by count DESC But I get this error; Unknown column 'count' in 'where clause' How do I get only those records whose group by count is above 5? -- My

mixing and matching mysql & mssql whileloop within an if case

2012-05-03 Thread Haluk Karamete
Please take a look at the following code and tell me if there is a way around it. if ($current_server_is_mysql): while ($row = mysql_fetch_assoc($RS)) { else: while( $row = sqlsrv_fetch_array( $RS, SQLSRV_FETCH_ASSOC)){ endif: Depending on the server I'm working with, I'd like to compile m

Re: The most elegant/efficient way to pull this SQL query

2012-04-12 Thread Haluk Karamete
My initial goal was to write a very convenient php function that display a table view based on arguments that are super simple to write - without requiring the developer to type-in ( or know ) the ins and outs of joins, natural joins etc. Something like this function showtable($dbh,$table,$fields)

Re: a sql injection attempt

2012-02-13 Thread Haluk Karamete
Gary, you've mentioned that the user would have had access to the sysobjects Let's assume he did. The page that this attempt occurred is hard-wired to display a single record in detail view. In the code, I have a bunch of echo $row- wrote: > On 13/02/2012 21:48, Haluk Karamete wr

Re: a sql injection attempt

2012-02-13 Thread Haluk Karamete
sorry, i overlooked that this IS a mysql mailing-list and we are running ms-sql in this particular case. good catch... I'd appreciate any insight though. On Mon, Feb 13, 2012 at 1:56 PM, Gary Smith wrote: > On 13/02/2012 21:48, Haluk Karamete wrote: >> >> My logs shows that

a sql injection attempt

2012-02-13 Thread Haluk Karamete
My logs shows that we have tried with a SQL Injection attempt, but our engine has detected and avoided it but I am just curious, what are these SQL statements are intending to achieve? SELECT * FROM lecturer WHERE recID='25 ' and exists (select * from sysobjects) and ''='' ORDER BY EntryDate DES

Re: case insensitivity

2012-01-16 Thread Haluk Karamete
f any? On Mon, Jan 16, 2012 at 7:41 PM, Willy Mularto wrote: > use LIKE > > > > On Jan 17, 2012, at 10:36 AM, Haluk Karamete wrote: > >> How do I do case insensitive searches and replace operations? >> Is there an easy way to do this? Like some sort of a server l

case insensitivity

2012-01-16 Thread Haluk Karamete
How do I do case insensitive searches and replace operations? Is there an easy way to do this? Like some sort of a server level setting telling mySQL to ignore case for once and for all? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.