Search found 212 matches

by chris
Thu Sep 06, 2012 3:22 pm
Forum: MySQL
Topic: Solved: convert MySQL db from Latin1 to UTF8
Replies: 7
Views: 233208

Re: convert MySQL db from Latin1 to UTF8

Are your text string wrong in the database, or do you see the results in you browser.

Because the problem with character set is that all programs need to know what character set is used.
Not only the database server (MySQL), but also the application server (php/apache, ASP/IIS, ...) and your ...
by chris
Wed Sep 05, 2012 3:49 pm
Forum: SQL
Topic: How do I find the size of my database?
Replies: 1
Views: 29415

Re: How do I find the size of my database?

With MySQL you can give the following command:
SELECT table_schema "database_name",sum( data_length + index_length ) / 1024 /1024 "Data Base Size in MB" FROM information_schema.TABLES GROUP BY table_schema;

This tells the size in MB.

But you can install phpMyAdmin ( http://www.phpmyadmin.net ...
by chris
Sun Sep 02, 2012 12:02 pm
Forum: Servers
Topic: convert MySQL db from Latin1 to UTF8
Replies: 1
Views: 65105

Re: convert MySQL db from Latin1 to UTF8

You probably set
default-character-set=utf8
Under [client] in /etc/mysql/my.cnf

You also need to set it under [mysqld] ;
Actually character-set-server=utf8 would be better.

This should take care of the Server characterset .


For your database you have to do some additional steps.
in MySQL give ...
by chris
Sun Sep 02, 2012 12:02 pm
Forum: MySQL
Topic: Solved: convert MySQL db from Latin1 to UTF8
Replies: 7
Views: 233208

Re: convert MySQL db from Latin1 to UTF8

You probably set
default-character-set=utf8
Under [client] in /etc/mysql/my.cnf

You also need to set it under [mysqld] ;
Actually character-set-server=utf8 would be better.

This should take care of the Server characterset .


For your database you have to do some additional steps.
in MySQL give ...
by chris
Thu Aug 30, 2012 3:30 pm
Forum: SQL
Topic: Set bit to TRUE/FALSE
Replies: 1
Views: 29077

Re: Set bit to TRUE/FALSE

You can use TININT(1) to set a value of 1 bit (0 or 1).

But my personal favorite is EMNUM

Code: Select all

valuename enum('true','false') NOT NULL default 'false'
note: ENUM can have more then 2 values, up to 65,535.
by chris
Wed Aug 22, 2012 3:52 pm
Forum: SQL
Topic: SQL count results from group by
Replies: 1
Views: 28698

Re: SQL count results from group by

There is a nice solution in MySQL.

Add the keyword SQL_CALC_FOUND_ROWS right after the keyword SELECT :
SELECT SQL_CALC_FOUND_ROWS table1.id, table2.name,table3.name FROM table1, table2, table3
WHERE (associate table1, table2 and table3 to each other)
GROUP BY table1.id LIMIT 10,20

After that ...
by chris
Wed Aug 22, 2012 3:47 pm
Forum: Servers
Topic: Where does MySQL store it database files
Replies: 2
Views: 74470

Re: Where does MySQL store it database files

This is set by datadir in my.cf (/etc/mysql/my.cnf) in Linux,
or my.ini (C:\Program Files\MySQL\MySQL Server 5.1\my.ini) in Windows

Standard it is in Linux:
datadir = /var/lib/mysql

in Windows:
datadir="C:/Documents and Settings/All Users/Application Data/MySQL/MySQL Server 5.1/Data/"
by chris
Wed Aug 22, 2012 3:47 pm
Forum: MySQL
Topic: Where does MySQL store it database files
Replies: 2
Views: 74994

Re: Where does MySQL store it database files

This is set by datadir in my.cf (/etc/mysql/my.cnf) in Linux,
or my.ini (C:\Program Files\MySQL\MySQL Server 5.1\my.ini) in Windows

Standard it is in Linux:
datadir = /var/lib/mysql

in Windows:
datadir="C:/Documents and Settings/All Users/Application Data/MySQL/MySQL Server 5.1/Data/"
by chris
Thu Aug 16, 2012 9:05 am
Forum: PHP
Topic: Solved: How to open 2 mysql databases in php
Replies: 2
Views: 67935

Re: How to open 2 mysql databases in php

You can add a 4th parameter in mysql_connect,
this will open a new separated connection.

$dbconn1 = mysql_connect($hostname, $username, $password);
$dconn2 = mysql_connect($hostname, $username, $password, true);

mysql_select_db('database1', $dbconn1);
mysql_select_db('database2', $dbconn2 ...
by chris
Mon Jun 18, 2012 11:25 am
Forum: HTML
Topic: max width of a table
Replies: 1
Views: 68226

Re: max width of a table

you can use max-width in css.

for example you can use the following class:
.bigtable{max-width:1024px;valign:top;margin-left: auto;margin-right: auto}

max-width:1024px : The maximum size of your table will be 1024 pixels.
valign:top : position of the table
margin-left: auto;margin-right: auto ...