mysql

What is the correct datatype for storing hashed passwords in mysql?

Hello, I am writing an application in ColdFusion where storing passwords is necessary. I plan to hash the passwords on the server (using the SHA512 Hash function in ColdFusion) before inserting them into a password column in my database. I would like to know what datatype to use for the password column. Many thanks! ...

Select the number of rows instead of the content in it

Once, I used this query to select the number of items in order to create a list of pages: SELECT COUNT(id) FROM lists WHERE online = 1 But now it has become difficult, since there are more conditions. Now I need to know the number of lists that are online which have subtitles which have list items in it. I tried the following, but it...

How to schedule remote mysql backups on windows

Hi guys and gals! I am looking for a smart way to take care of scheduling backups on a remote Mysql Unix/Linux server from my own personal Windows XP computer. Is there any (free if possible, preferable of course) software that i can schedule that logs in to a mysql database and downloads a complete backup? Would also need an alterna...

Should I store a serialized object or JOIN tables in PHP/MySQL?

I'm currently building a site that gives a lot of sorting options to the user and I want to build it in a way that it can be scaled without too much headache. Of course there are tradeoffs to both of these techniques, but id like to hear your opinions. 1) Store a serialized json array in a single column. When a new entry is added or re...

Mysql Backup with Mercurial

Hi friends, is it possible to take ? I researched at Google, I found few articles, but in German and other langs, so didnt understand well. It would be great if we could get mysql back-up from server to localhost with Mercurial [at localhost]. maybe with Remote Mysql Connection, etc. do you know any way of doing this? is it possible? ...

Mysql not retaining line breaks from Jquery ajax post?

Hey SO, I've got a PHP/Mysql app that lets users post text from a form. When I insert text from an HTML textarea into my mysql table, it's not keeping the carriage returns/line breaks. The text is not stored in the DB as "Hey SO, \n This is a new line". It's stored with white space in the column (exactly like it's typed), but there is ...

Zookeeper/Chubby -vs- MySql NDB

I have been reading the Paxos paper, the FLP theorem etc. recently and evaluating Apache Zookeeper for a project. I have also been going thru Chubby (Google's distributed locking service) and the various literature on it that is available online. My fundamental usecase for Zookeeper is to implement replication and general coordination fo...

Thinking logically about a database structure: Adding 'tags' to things users post - A seperate table or...?

Hi everyone! I'm still beginning to get my head around this whole relational-database-thingymawhatsit. Anyway, I'm a PHP programmer so I can do all that shabang. I just need to think what would be the best method for this scenario... I'm developing a site (with CodeIgniter if that's any help) - a site where users can post content (thi...

Multi-tiered MySQL query?

I have two tables(entries and tags) with a many-to-many linking table. Right now, I'm making a query to retrieve all the entries that meet my criteria, and a query for each entry to retrieve the tags. Would there be a way to say, have the tags returned through a new column as an array in the first query? ...

Help with MySQL SELECT statement, multiple tables

I have the following tables: reg_season +--------+--------+---------+------+--------+ | season | league | team | wins | losses | +--------+--------+---------+------+--------+ | 1962 | AL | Yankees | 96 | 66 | +--------+--------+---------+------+--------+ postseason +--------+---------+----------+ | season | team | f...

Show distinct selection in webform?

If I use a regular distinct selector with MySQL and show the results in a repeater I can show the the data in the webform with the following code. <%# DataBinder.Eval(Container.DataItem, "posted") %> But If I use this code: "SELECT DISTINCT mid(posted,6,1) ORDER BY posted DESC" I get the following error trying to use the code above...

how to backup mysql database outside phpmyadmin

I'm currently using the export function in phpmyadmin to update mysql database. How do I do it outside phpmyadmin, is there any other application that could do this? ...

no previous outfile available in mysql console

mysqlhotcopy hospital C:\Temp I'm using the code above to backup the hospital database in MySQL. But it said that "no previous outfile available, you must give a filename." How do I properly do it? ...

How to insure column match for MySQL insert, when number and names of input fields will vary?

Hello! Working on a pre-existing program that parses an html form that has a dynamically created number of fields, and in the interest of forward-compatibility, may not even know number of mysql columns... I imagine that this requires creating two arrays, and comparing/re-ordering of some sort, but can't quite wrap my head around it......

PHP/MySQLi not honouring the ORDER clause when looping through results

I've built the following query programatically, but I have confirmed the query as being what is sent through the MySQLi query function. SELECT * FROM `movie_cast` JOIN `movie_x_movie_cast` ON `movie_id` = "7" AND `movie_role_id` = "2" AND `movie_cast`.`id` = `movie_x_movie_cast`.`movie_cast_id` ORDER BY `surname` DESC The p...

MySQL: How many queries per page is too many?

I'm new to MySQL and something that's quickly becoming obvious to me is that it feels considerably easier to create several database queries per page as opposed to a few of them.... but I don't really have a feel for how many queries might be too many, or at what point I should invest more precious time to combining queries, spending tim...

Calling Stored Procedure using ADODB in PHP

I couldn't find a proper documentation on how to call a stored procedure using ADODB in PHP. Can someone help please? This is what I have now and I feel it's a dirty approach (or not?): $stmt = "CALL LocFillData('foo', 'bar', @nullcount, @totalcount)"; $rsstmt = "SELECT @nullcount, @totalcount"; $rs = $db->Execute($stmt); $rsstmt = $db...

PHP file not successfully receiving AJAX variable

Here is what I have going on in my AJAX: $('#submit-button').click(function(){ var twit = $('input#twittername').val(); var email = $('input#email').val(); if((email == "" || email == "[email protected]") && (twit == "" || twit == "@twittername")){ $('p#empty-error').fadeIn(); return false; } var datastri...

Pooling mysql on c#

Hi, I'm using mysql database for my site, i want to use mysql pooling. How do I implement mysql pooling on c# environment ? i"m using the connection string like this example : User ID=root;Password=myPassword;Host=localhost;Port=3306;Database=myDataBase; Direct=true;Protocol=TCP;Compress=false;Pooling=true;Min Pool Size=0;Max Pool Si...

Use A Union Or A Join - What Is Faster

I just wonder if you had a table and you unioned it would it be more efficent then using a join?? I do know that the join creates more columns but this is more theoretical - Will the union need to do a nested loop scan of the other table like a join would have to? ...