mysql

Preventing spam bots on site?

We're having an issue on one of our fairly large websites with spam bots. It appears the bots are creating user accounts and then posting journal entries which lead to various spam links. It appears they are bypassing our captcha somehow -- either it's been cracked or they're using another method to create accounts. We're looking ...

Is there a command to test an SQL query without executing it? ( MySQL or ANSI SQL )

Is there anything like this: TEST DELETE FROM user WHERE somekey = 45; That can return any errors, for example that somekey doesn't exist, or some constraint violation or anything, and reporting how many rows would be affected, but not executing the query? I know you can easily turn any query in a select query that has no write or del...

MySQL multidimensional arrays...

What is the best way to store data that is dynamic in nature using MySQL? Let's say I have a table in which one item is "dynamic". For some entries I need to store one value, but for others it could be one hundred values. For example let's say I have the following simple table: CREATE TABLE manager ( name char(50), worker_1_name(50)...

SOLVED: deploying applications that use LINQ to Entities.

HI COMUNITY!!!! I want to use L2E since it s very convenient to my company's apps, I created a demo project, the demo does run on every machine but when I, lets say, press a button that has some code that uses the entity I get this error: specified store provider cannot be found in the configuration, or is not valid. note that I get ...

JQUERY - Find all Elements with Class="X" and then POST all those elements to the server to INS into the DB

Given a large text block from a WYSIWYG like: Lorem ipsum dolor sit amet, <span class="X" id="12">consectetur adipiscing elit</span>. Donec interdum, neque at posuere scelerisque, justo tortor tempus diam, eu hendrerit libero velit sed magna. Morbi laoreet <span class="X" id="13">tincidunt quam in facilisis.</span> Cras lacinia turpis v...

List MySQL enum in Java

Is there a way to get all possible values from a MySQL enum column? The MySQL documentation says the MySQL enum type is returned as a Java String, so I basically would like a way to get all possible strings I can pass when querying a table with such an enum. I couldn't immediately find anything when I was looking through the metadata r...

MySQL only returning one result. Im Baffled.

Here is te code: <?php //Starting session session_start(); //Includes mass includes containing all the files needed to execute the full script //Also shows homepage elements without customs require_once ('includes/mass.php'); $username = $_SESSION['username']; if (isset($username)) { //Query database for the users networths ...

MySql query BETWEEN two Strings sometimes doesn't work

I have a mysql query where a subquery is: BETWEEN '5.00' AND '10.00' And this returns no results. However when I use Floats or Ints: BETWEEN 5 and 10 it works The BETWEEN query also works for other values AS strings, but just not for 5 and 10. EG: BETWEEN '4' AND '5' works. How could this be? ...

Converting a string to a mySql DECIMAL type

I am trying to insert data about an item's price from an HTML form into a mySQL database. The input field is defined as follows: <input type="text" name="price" value="0.00"/> The form is POSTed to the next page in which the database stuff is taken care of. Currently I just enter the exact contents of $_POST['price'] into the database...

Writing an optimised and efficient search engine with mySQL and ColdFusion

I have a search page with the following scenarios listed below. I was told using so many conditional statements degrades performance, but I don't know if any other way to achieve the same objective. Search.cfm will processes a search made from a search bar present on all pages, with one search input (titleName). If search.cfm is access...

PDO Prepare statement not processing parameters

I've exhausted all efforts at what appears to be a trivial problem, but gotten nowhere. There is a simple Prepare statement: $qry = $core->db->prepare("SELECT * FROM users WHERE email = '?'"); $qry->execute(array('[email protected]')); However, no rows are returned. Running the query with the parameters hardcoded into the query resul...

How can I alter a temp table?

I need to create a temp table, than add a new int NOT NULL AUTO_INCREMENT field to it so I can use the new field as a row number. Whats wrong with my query? SELECT post, newid FROM ((SELECT post`test_posts`) temp ALTER TABLE temp ADD COLUMN newid int NOT NULL AUTO_INCREMENT) edit: SELECT post, newid FROM ((SELECT post, newid as int ...

Sql query Error: Operand should contain 1 column(s) in rails

Hi everyone, SELECT * FROM `jobs` WHERE (SELECT DISTINCT jobs.* FROM jobs, job_requests WHERE (jobs.user_id = 1) OR (job_requests.user_id = 1 AND job_requests.job_id = jobs.id) ) This sql gives me: Mysql::Error: Operand should contain 1 column(s). If I execute the select from the wh...

In 64 bit systems, a 32 bit column occupies less space than a 64 bit one?

In MySQL running on a 64bit OS, every column occupies at least 64 bits? A bit would occupy a whole byte? or a whole word? ...

Recursively MySQL Query

How can I implement recursive MySQL Queries. I am trying to look for it but resources are not very helpful. Trying to implement similar logic. public function initiateInserts() { //Open Large CSV File(min 100K rows) for parsing. $this->fin = fopen($file,'r') or die('Cannot open file'); //Parsing Large CSV file to get dat...

Can you hide tables from a MySQL user in phpMyAdmin?

I have a MySQL user added to a database that I would like to prevent from viewing certain tables. I can limit their privileges through MySQL by preventing them from running statements like DROP or ALTER. But is it possible to prevent them from viewing certain tables in phpMyAdmin? If there isn't a MySQL privilege that controls this (I...

MYSQL query results cut short when Sort is DESC and limited

Hi... Seeing some strange things; help is being solicited. I have a query, like so: (using CodeIgniter, btw) 'SELECT * FROM registers WHERE client_id='.$clid .' ORDER BY date DESC LIMIT '.$num $num is passed in through the function call (and it==15), and is echoing properly. But running this returns only 10 rows. If I explicitly set ...

How I can Optimize this mySQL transaction within java code?

Dear All, I am new to MySql database. I've large table(ID,...). I select ID frequently with java code and.And that make a heavy load on transaction select from tableName where ID=someID notes: 1.Database could be 100,000 records 2.I can't cache result 3.ID is a primary key 4.I try to optimize time needed to return result from que...

MySql scoping problem with correlated subqueries

Hi, I'm having this Mysql query, It works: SELECT nom ,prenom ,(SELECT GROUP_CONCAT(category_en) FROM (SELECT DISTINCT category_en FROM categories c WHERE id IN (SELECT DISTINCT category_id FROM m3allems_to_categories m2c WHERE m3allem_id = 37) ) cS ) categories ,(SELECT GRO...

Locking a detail view if a user is editing the item...

Hi All I am developing a user manager which must control access to the detail view of editable items. At present, when a user clicks 'edit', the application queries the link table to check if a user is currently editing that page, if not, it allows access to the page and then inserts a record into the link table preventing another user ...