mysql

As3 & PHP URLEncoding problem!

Hi everyone, I'm stuck with a stupid problem of encoding. My problem is that all my accentuated characters are displayed as weird iso characters. Example : é is displayed %E9 I send a string to my php file : XMLLoader.load(new URLRequest(online+"/query.php?Query=" + q)); XMLLoader.addEventListener(Event.COMPLETE,XMLLoaded); When I...

how to debug MySql stored procs without breaking control flow from application

Is there a way to do the following: I have a MySQL DB , and there are many stored procs written in it as well. I use MySQL client library in C to connect to this DB and amongst other things , call the stored procedures. Is there a way to set breakpoints in the stored procedures such that when the call is made from C program ( using myS...

Find the table(column) that a FK links to? MySql

I am ok with mysql. when i use desc tablename i can see columns with MUL meaning it is a foreign key. Now my question is, how do i find out exactly what table and column that column is pointing to. ...

I want to insert Date like 24-05-2010 in MySQL Database

I am using C# code for inserting record and datetimepicker control for Date I want to insert Date like 24-05-2010 in MySQL Database What Datatype i have to use for that in MySQL table and how to right insert query for to insert date? ...

Converting delimited string to multiple values in mysql

I have a mysql legacy table which contains an client identifier and a list of items, the latter as a comma-delimited string. E.g. "xyz001", "foo,bar,baz". This is legacy stuff and the user insists on being able to edit a comma delimited string. They now have a requirement for a report table with the above broken into separate rows, e.g....

Sort and limit queryset by comment count and date using queryset.extra() (django)

I am trying to sort/narrow a queryset of objects based on the number of comments each object has as well as by the timeframe during which the comments were posted. Am using a queryset.extra() method (using django_comments which utilizes generic foreign keys). I got the idea for using queryset.extra() (and the code) from here. This i...

Cannot connect to MySQL with JDBC - Connection Timeout - Ubuntu 9.04

I am running Ubuntu and am ultimately trying to connect Tomcat to my MySQL database using JDBC. It has worked previously but after a reboot the instance now fails to connect. Both Tomcat 6 and MySQL 5.0.75 are on the same machine Connection string: jdbc:mysql:///localhost:3306 I can connect to MySQL on the command line using the mysq...

MySQL & PHP Parameter 1 as Resource

Alright, PHP is throwing this error at me (in the log) when I run the code mentioned below: Error mysql_num_rows() expects parameter 1 to be resource, string given in (place) on line 10 Line 9-11 $queryFP = ("SELECT * FROM db"); $countFP = mysql_num_rows($queryFP); $aID = rand(1, $countFP); I think it has something to do with the ...

Mysql query problem

Below is an over-simplified version of table I'm using: fruits +-------+---------+ | id | type | +-------+---------+ | 1 | apple | | 2 | orange | | 3 | banana | | 4 | apple | | 5 | apple | | 6 | apple | | 7 | orange | | 8 | apple | | 9 | apple | | 10 | banana | +...

Specific query in Mysql

I have two tables reports and holidays. reports: (username varchar(30),activity varchar(30),hours int(3),report_date date) holidays: (holiday_name varchar(30), holiday_date date) select * from reports gives +----------+-----------+---------+------------+ | username | activity | hours | date | +----------+-----------+------...

PhpMyAdmin; Should I disable root login?

I have this setup in Phpmyadmin: USER HOST PASSW PRIVILEGES GRANT debian-sys-maint localhost Yes ALL PRIVILEGES YES phpmyadmin localhost Yes USAGE NO root 127.0.0.1 Yes ALL PRIVILEGES YES root...

MySQL comment table structure question.

I wanted to add comments and replies to comments to my website for my members but I was wondering how would my mysql tables look like for my comments and replies to comments? Can someone give me some examples thanks! ...

Good tutorial on how to add comments to your web site using PHP & MySQL

I was wondering what is a good tutorial on how to create PHP & MySQL comments for my website users. ...

Problem with sending "SetCookie" first in php code

According to this manual: http://us2.php.net/setcookie I have to set the cookie before anything else. Here is my cookie code: if (isset($_COOKIE['watched_ads'])){ $expir = time()+1728000; //20 days $ad_arr = unserialize($_COOKIE['watched_ads']); $arr_elem = count($ad_arr); if (in_array($ad_id, $ad_arr) == FALSE){ ...

Zend Framework multiple databases

I'm currently using only one database with Zend Framework, but now I have to add ONE MORE. I'm using this code right now: public static function setupDatabase() { $config = self::$registry->configuration; $db = Zend_Db::factory($config->db->adapter, $config->db->toArray()); $db->query("SET NAMES 'utf8'"); self::$reg...

mysql phpmyadmin, how to save date of birth that was attained through a form with the input type "select"(drop down)

Hello, I have a form which asks the user his or her date of birth. Its a drop down box since I use the select input type. The first drop down has Months, second has Days, the third has the Years. So the format should be Month(October), Day(25), Year(1990). In other words the months spell out the actual month and not simply the number r...

Optimizing MySql query to avoid using "Using filesort"

I need your help to optimize the query to avoid using "Using filesort".The job of the query is to select all the articles that belongs to specific tag. The query is: select title from tag, article where tag = 'Riyad' AND tag.article_id = article.id order by tag.article_id The tables structure are the followi...

Wordpress $wpdb->options

Where does $wpdb->options come from? I can't see $wpdb-options() function or $this->options so how is this achieved? ...

Trying to Select and Update the Same Rows Quickly

I have a MySQL table that's being updated very frequently. In essence, I'm trying to grab 500 rows with multiple PHP scripts at once, and I don't want the PHP scripts to grab the same rows. I don't to use ORDER BY RAND() due to its server load with thousands of rows. So, I thought of simply having each script set every row's status as "...

Lexing partial SQL in C#

I'd need to parse partial SQL queries (it's for a SQL injection auditing tool). For example '1' AND 1=1-- Should break down into tokens like [0] => [SQL_STRING, '1'] [1] => [SQL_AND] [2] => [SQL_INT, 1] [3] => [SQL_AND] [4] => [SQL_INT, 1] [5] => [SQL_COMMENT] [6] => [SQL_QUERY_END] Are their any at least lexers for SQL that I base...