Showing posts with label sql. Show all posts
Showing posts with label sql. Show all posts

Friday, June 8, 2012

Joins are for lazy people?


I recently had a discussion with another developer who claimed to me that JOINs (SQL) are useless. This is technically true but he added that using joins is less efficient than making several requests and link tables in the code (C# or Java).

Wednesday, May 30, 2012

What are the pros and cons to keeping SQL in Stored Procs versus Code


What are the advantages/disadvantages of keeping SQL in your C# source code or in Stored Procs? I've been discussing this with a friend on an open source project that we're working on (C# ASP.NET Forum). At the moment, most of the database access is done by building the SQL inline in C# and calling to the SQL Server DB. So I'm trying to establish which, for this particular project, would be best.

Tuesday, May 29, 2012

Thursday, May 24, 2012

datetime vs timestamp?


What would you recommend using between a datetime and a timestamp field, and why? (using mysql). I'm working with php on the server side.

Best way to stop SQL Injection in PHP


So specifically in a mysql database, I understand that this is vulnerable to SQL injection . Take the following code and tell me what to do.

Wednesday, May 16, 2012

Is it ok to store presentation data in the database?


I am to displaying rows from a database (SQL SERVER 2005) table in a webpage. These rows contain a statusID (foreign key) that is further defined by Status table (eg. id, name, modifiedDate).

Wednesday, May 9, 2012

Get database schema with one query?


Basically I want to get the table names, and the field names for each table from the current database that is connected, nothing else.

Friday, May 4, 2012

SQL & PHP - Which is faster mysql_num_rows() or "select count()"?


I'm just wondering which method is the most effective if I'm literally just wanting to get the number of rows in a table.

Wednesday, April 25, 2012

Php & Sql Injection - UTF8 POC


There is a lot of talk about how addslashes and mysql_real_escape function are not safe to prevent injections. The truth is even the big frameworks or CMSs like Wordpress are using this functions and they do a god job so far.

Print query string in hibernate with parameter values


Is it possible in hibernate to print generated sql queries with real values instead of question marks?

Monday, April 23, 2012

Php & Sql Injection - UTF8 POC


There is a lot of talk about how addslashes and mysql_real_escape function are not safe to prevent injections. The truth is even the big frameworks or CMSs like Wordpress are using this functions and they do a god job so far.

What"s the difference between (INNER JOIN,LEFT JOIN,RIGHT JOIN,FULL JOIN) in Mysql


I want to know What's the difference between INNER JOIN,LEFT JOIN,RIGHT JOIN,FULL JOIN in Mysql

SQL injection that gets around mysql_real_escape_string()


Is there an SQL injection possibility even when using mysql_real_escape_string() function?

Thursday, April 12, 2012

MySQL INTO OUTFILE overide existing file?


I've written a big sql script that creates a CSV file. I want to call a cronjob every night to create a fresh CSV file and have it available on the website.

Friday, April 6, 2012

Are there any differences between SQL Server and MySQL when it comes to preventing SQL injection?


I am used to developing in PHP/MySQL and have no experience developing with SQL Server. I've skimmed over the PHP MSSQL documentation and it looks similar to MySQLi in some of the methods I read about.

Saturday, February 25, 2012

How to auto insert Current DATE in SQL with Java / Hibernate


I need to add automatically the current date into my Database when I create a new OperantionBank. I'm using Hibernate. Thanks

Monday, February 20, 2012

Subquery returns more than 1 row


All



I have two table enter image description here



1st table is : wp_frm_item_metas 2nd table is : wp_frm_items

Friday, February 10, 2012

What datatype is best for storing articles in SQL database?


I'm creating a custom CMS for my site, and I'm going to store articles (Text and images per article) in a mysql database. what datatype is best suited for that task?

Sunday, January 29, 2012

Is it preferred to assign POST variable to an actual variable?


I've just completed my registration form for my website and for the action page where all the SQL takes place I've just skipped assigning the POST variable to actual ones, like this...