Search found 197 matches

by chris
Wed Aug 22, 2012 3:52 pm
Forum: SQL
Topic: SQL count results from group by
Replies: 1
Views: 17443

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, run a...
by chris
Wed Aug 22, 2012 3:47 pm
Forum: Servers
Topic: Where does MySQL store it database files
Replies: 2
Views: 30571

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: 23808

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: 22072

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); $result1...
by chris
Mon Jun 18, 2012 11:25 am
Forum: HTML
Topic: max width of a table
Replies: 1
Views: 22649

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 : it c...
by chris
Sun Apr 15, 2012 10:01 pm
Forum: Apache
Topic: kubuntu stop apache from starting automatically
Replies: 1
Views: 24570

Re: kubuntu stop apache from starting automatically

You can use update-rc.d

Code: Select all

update-rc.d apache2 disable
The remove will completely remove the startup files,
you don't want that.

Code: Select all

update-rc.d -f apache2 remove
Hope this is what you are looking for.
by chris
Mon Apr 09, 2012 11:03 am
Forum: Apache
Topic: Solved: ssl not working on apache
Replies: 2
Views: 25581

Re: ssl not working on apache

Usually it means there are still some settings wrong with your apache configuration. Make sure all the port is set : Listen 10443 But also NameVirtualHost *:10443 and <VirtualHost *:10443> you can find the settings in /etc/apache2/httpd.conf or for virtual hosts /etc/apache2/vhosts.d/0x_yoursite.con...
by chris
Tue Mar 20, 2012 7:29 pm
Forum: Servers
Topic: Solved: How do I let a service start at boot on CentOS
Replies: 2
Views: 30564

Re: How do I let a service start at boot on CentOS

You can do this with the builtin chkconfig utility: sudo /sbin/chkconfig --list This command show you all the services and their status on each runlevel. If you don't see your service in it (mysqld for example?), you can add it. sudo /sbin/chkconfig --add mysqld You also need to set it to ON, in the...
by chris
Thu Mar 15, 2012 6:05 pm
Forum: HTML
Topic: back button
Replies: 1
Views: 22733

Re: back button

Just create a button with a little javascript.

Code: Select all

<form>
<INPUT type="button" value="Click here to go back" onClick="history.back()">
</form>
That should work in any browser.
by chris
Thu Feb 02, 2012 2:17 pm
Forum: General
Topic: Solved: How to check urls in linux
Replies: 4
Views: 28692

Re: How to check urls in linux

Jus use grep to get the 404 error out: less links.txt | grep -B 4 '404 Not Found' -B 4 tells grep to also return the 4 lines before each match. You don't want linkchecker to test the amazon URLs, you can exclude them: linkchecker --ignore-url="amazon" http://www.sitetotest.com > links.txt