mysql

PHP Mysql Poll exam inserting?

Hi i have my database table question: id question 1 myquestion1 2 myquestion2 3 myquestion3 4 myquestion4 5 myquestion5 table answer: id qid userid answer 1 1 1 myanswer 2 2 1 myanswer 3 3 1 myanswer 4 4 1 myanswer 5 5 1 myanswer My problem is how ca...

Is there a way to retroactively create time/node based UUID in PHP?

Most time-based (type 1) UUIDs are created using the current time. I'm migrating a MySQL database to cassandra and would like to create timebased UUIDs for archived items. Can someone provide an example of how type-1 UUIDs are created using past time periods? ...

Firefox showing records size as 2MB ,

Hi , Am simply executing query , The record count just 2980 , but it allocate around 2MB , I dont How its 2mb, just rendering records without css , how to track , For what reason it showing as 2MB , ...

MySql Select Query

I have 2 tables like this Table 1 Id f1 f2 1 ABC red,green 2 DEF blue,yellow Table 2 id color value 1 red r 2 green g 3 blue b 4 yellow y How Can I get result like this f1 f2 values ABC red,green r,g DEF blue,yellow b,y Thanks i...

How can i fill my mysql tables with test data of about 100,000 records?

Hi Guys; I know that i will have to write some sort of script for this but? can you guys guive me a go ahead on hwo to do it as i havent done it before. Thanks ...

How to add +1 to already existing values

I have table with the column name displayorders with values 1 to 250 and it's not autoincrement. Now I want to add a new row in table with displayorder = 3. So I don't want to manually update all the values form 3 to 250.Instead of that I want to update all the displayorders to +1 and I can manually change from 1 to 2(ie 2 to 3 after ...

[PHP MYSQL] Warning: mysql_num_rows() expects parameter 1 to be resource

I am getting this warning: Warning: mysql_num_rows() expects parameter 1 to be resource On this script: if (isset($_POST['submit'])){ change_db($realm_DB); $loginusername = "$acc_name"; $loginpass = $_POST['password']; $sha_pass_hash = sha1(strtoupper($loginusername) . ":" . strtoupper($loginpass)); $qry=mysql_q...

How to create dynamic reports in PHP with Mysql

I'm designed a web application in PHP which conects to a database in MySQL, this application will generate reports according to the fields that a user choose from diferents tables, there is a way to do this, preference by code. (and software tool is acceptable too) ...

pivot table: getting data from one column

lets say my table like: Date Status 2010-01-02 2010-01-03 accept 2010-01-03 accept 2010-01-03 reject 2010-01-03 2010-01-04 reject i want if value null, it means accept. Beside that i want show the result like: Date Accept Reject 201...

How to write in new database table in zen cart

I have created a new database table with the name 'table'. Now i'm trying the following code to write the data into the fields: if (isset ($_POST['request'])) { $F1 = $_POST['F1']; $F2 = $_POST['F2']; $F3 = $_POST['F3']; $F4 = $_POST['F4']; $sql_data_array = array('F1' => zen_db_prepare_input($_POST['F1']), 'F2' => zen_db_prepare_inpu...

is this possible to made two primary key in one table

hi i want to know that is is possible to make primarykey in one table in mysql. if yes please tell me the concept behind this. because i have seen a table in which two primary key is there with no auto increment set ...

Have week number how to compute last day of the week?

I have the week number and year as separate fields in MySQL, how do I compute the last day of the week(Sunday) in the given year? ...

PHP: Filter MYSQL array

Hey, I'm developing an visits counter and I'd like to increase a number depending on the browser and the operating system. For example: Firefox Mac OS X Safari Mac OS X Firefox Mac OS X Firefox Linux Then the website would display Safari on Mac OS X 1 visit Firefox on Mac OS X 2 visits Fire...

Building a select distinct on mysql ( zend_db)

I HAVE THE FOLLOWING TABLE, I WOULD LIKE TO GET to do a select distinct on the the column [code], i don't need to get the "A" three times. [ ID ] [ CODE ] [ LIBELLE ] 1 A LIBELLE1 2 B LIBELLE2 3 C LIBELLE3 4 A LIBELLE4 5 A LIBELLE5 6 D LI...

Where are Custom Menus saved in the Database for Wordpress 3.0?

I've been searching and searching my sql database in phpmyadmin but I can't seem to find where custom menus are stored in the database. Anyone know where it's stored? I have a large menu basically that takes forever to create. I'm in development now and rather than recreating it in production I want to try and copy the sql over to see if...

MySQL error USING BTREE

I have a mysql database I have downloaded from my online server and trying to import on my local mysql but its not working showing this syntax error. I cannot find any errors in this query This is the error: 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right synt...

delete duplicate record from same table in mysql

I have one table named tblm_customer. It contain field named firstname and lastname. Now I want to delete all records from the table that contain the same firstname and lastname that are already in the table. I used mysql database and customerid is the primary key in the table. ...

Concept for archiving huge database

I need a concept how I can archive all data in D-Pool which is older than one year. At the moment we have more than 3 million records in the D-Pool. Because of this huge data foundation searches and filters over the database takes quite too long, because most searches are done over the whole D-Pool data, but in most cases I am only inter...

JSP/Servlets: How do I Upload a zip file, unzip it and extract the CSV file...

Hi all, Wondering how can I do the following in JSP/Servlets: Upload a zip file (containing multiple CSV files) Unzip the file to obtian the CSV files Read the CSV files and pump the records into a mySQL database Note: mySQL table is set up and ready for CSV files inputs. Thanks in advance. ...

Sql Query - Unique item with latest date of entry

**Update: Title should have read: Sql Query - Unique item with latest entry Hi there, I have a two tables. users and rsvp. Users has user detail in it (id, name, email) rsvp has rsvp status in it (answerid, userid, eventid, answer) Note: answer 1 = coming answer 2 = not coming answer 3 = maybe answer 4 (pseudo answer) = no reply Plea...