mysql

Printing out 25 most recently added tables

Hello, In the code below, I allow users to add tables to a MySQL database. Is there a way to print out the most recent 25 tables added? Thanks in advance, John $table = mysql_real_escape_string($_POST['name']); $query = "CREATE TABLE `$table` (id INT(11) NOT NULL auto_increment, site VARCHAR(350) NOT NULL, cat1 BIGINT(9) NOT NULL, ...

Problems importing a CSV file

When i try to import a CSV file into my mysql database I get this error "Invalid field count in CSV input on line 1". But i am sure that my csv file is fine. Below is the first line of the csv file and the structure of the databse: "","[email protected]","Licia Dallolio","390","37","","", CREATE TABLE `other_table` ( `id` int(11) N...

Where can I get a PHP / MYSQL chat room application

My question is an elaboration of this one: http://stackoverflow.com/questions/1093251/php-mysql-ajax-chat I have a 100 chat rooms which I need to make. Is there a php/mysql based chat system that would do something like this? phpFreeChat is mentioned, but from what I understand, I have to (manually) download and install the applicatio...

Importing big (and corrupt?) plaintext files into mysql broken my lamp install

I was importing data from txt files into mysql (via php script). This dump is huge, it's splitted into 10 files. I imported first and second one and everything was ok - I could see all entries in phpmyadmin, etc. There were about 700 000(?) of entries. When i started to import third one something weird happened - import script loaded for...

How do I create a PHP/MySQL powered image gallery from scratch?

This question has been asked before mentioning the lib or includes that provides a functional gallery, But i want to create one from scratch. So any ideas on the following Galleries need to be uploaded using Form and Browse(This i can find no Problem, just need it to be there to outline the steps) Need to have a thumbnail image created...

I have a data base full of codes and I want to call this data by when it was submitted...

Okay, so I'm relatively new to coding but I have a table w/ over 1000 codes in it. Well, when people submit new information to it (via submit form) I want to be able to add the date/time to the table so that when I can print the 'latest 25'. My questions are: How do I add a column for the time? How do I add the time function to m...

UDF Performance in MySQL

I'm noticing exponential performance degradation in MySQL query execution times when queries include calls to UDF's in the SELECT or WHERE clauses. The UDF's in question query local tables to return scalar values - so they're not just performing arithmetic expressions, but serving as correlated subqueries. I've fixed the performance pr...

How do I store changing data into a database?

I made an application to take the now playing title and artist from an internet radio stream, and I have it displaying in plain text on this page: http://thelisthq.net/z1035.php The output is simply a php 'echo $variable' command, but $variable is constantly changing, so how do I store each different value of $variable into a database....

In MySQL, which collation should I choose?

When I create a new MySQL database through phpMyAdmin, I have the option to choose the collation (e.g.-default, armscii8, ascii, ... and UTF-8). The one I know is UTF-8, since I always see this in HTML source code. But what is the default collation? What are the differences between these choices, and which one should I use? ...

Avg Time difference in mysql

Is there a function to find average time difference in the standard time format in my sql. ...

Adding a hyperlink to a PHP-generated table

Hello, In the code below, I am trying to print out a 1-column, 25-row table, with each row being a hyperlink to "booksearch.php?find=urlencode('TABLE_NAME')&searching=yes&search=search". The hyperlink part is not working. For the line below with the hyperlink, I get this error message: "Parse error: syntax error, unexpected T_STRING, ...

mysql ndb cluster add data node

Hi All, This is my config.ini file options affecting ndbd processes on all data nodes: [ndbd default] NoOfReplicas=1 # Number of replicas DataMemory=80M # How much memory to allocate for data storage IndexMemory=18M # How much memory to allocate for index storage # For DataMemory and IndexMemory, we have use...

BeepBeep and ErlyDB integration issue

Further to my adventures with Erlang and ErlyDB. I am attempting to get ErlyDB working with BeepBeep My ErlyDB setup works correctly when run outside of the BeepBeep environment (see Debugging ErlyDB and MySQL). I have basically take the working code and attempted to get it running inside BeepBeep. I have the following code in my contr...

MySQL LOAD DATA - Loading a text file with ColumnName=Value format

I've started learning SQL over the past few days, but am stuck while attempting to get my data into the table. The data's stored in a text file with the format: ColumnName1=SomeInteger ColumnName2=SomeInteger ColumnName3=SomeString ... etc So far I've managed to create a table (which has about 150 Columns, that I'm hoping to split up...

MySQL LOAD DATA LOCAL INFILE example in python?

I am looking for a syntax definition, example, sample code, wiki, etc. for executing a LOAD DATA LOCAL INFILE command from python. I believe I can use mysqlimport as well if that is available, so any feedback (and code snippet) on which is the better route, is welcome. A Google search is not turning up much in the way of current info ...

Percona/XtraDB insllation + replication setup - tips/guides for Centos 5.2

I am looking for good articles on how to install and setup Percona's patched server with XtraDB and master/slave replication setup on Centos 5.2 64 bit. I believe they can be downloaded at http://www.percona.com/mysql/5.1.34-5/RPM/rhel5/? and is there any good recipes for setting up HA and replication? Thanks! ...

Listing categories with the latest comments/activities with MYSQL

I am developping a site where users can post comments and each comment is categorized. I have a page where users can go and see a list of all the categories on the site with the latest 5 comments posted in them. The information I need to retrieve from the database is: A list of categories 5 comments in each categories This is what...

How do I get the MySQL Connector/NET driver version programmatically ?

Is there an easy way to get the version of the MySQL driver programmatically from within a C# program referencing MySQL.Data.dll ? ...

Save loop result to a string

Hi everyone! Is it possible to save loop results to a string? $sql = "SELECT SUBSTR(a.`title`, 1,1) FROM articles a WHERE a.`tag` = 'human_resources'"; $results = db_query($sql); while ($fields = db_fetch_array($results)) { foreach($fields as $key => $value) { echo $value; } } The code above outputs titles of art...

MySQL error 150, cannot create table.

I'm having trouble creating a table and I don't understand what's wrong. phpMyAdmin sets the error indicator next to the PRIMARY KEY declaration... I don't get why this is wrong... This table is a child table, which has a one-to-many identifying relationship with another table. CREATE TABLE IF NOT EXISTS `ruilen`.`Voorwerpen` ( `voorwe...