To list all tables in the mysql database, you can use this SQL
show tables;
To list all tables in the mysql database, you can use this SQL
show tables;
Use this easy-to-install widget to show more related posts within your blog post
While looking at a software, we can follow the following criteria to judge a software.
This CSS to be used to display website nicely on iPhone. Not tested on Android and other smart phones.
Add this code on top of what ever css style you have.
1 2 3 4 5 | <!-- Start iPhone --> <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" /> <link rel="apple-touch-icon" href="/images/money.png" /> <link media="only screen and (max-device-width: 480px)" href="/iphone.css" type= "text/css" rel="stylesheet" /> <!-- End iPhone --> |
In iphone.css file, just write the css code. For example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | body,td,input,textarea,select,label { font-size: 6em;} mainlink {font-size:3em; } body { background-color: #fff; } .header, .footer { width: 100%; } .sidebar { display: none; } .mainlink { color:#FFFFFF; font-size:150%; } .mainlink A:link {text-decoration: none; color:#FFFFFF; } .mainlink A:visited {text-decoration: none; color:#FFFFFF; } .mainlink A:active {text-decoration: none; color:#FFFFFF; } .mainlink A:hover {text-decoration: underline; color:#FFFF66; } |
If you have problem accessing your MySQL database with this error
ERROR 1045: Access denied for user: ‘root@localhost’ (Using password: NO)
You can try reset your root password with the following steps:
1. Create a txt file with this content
UPDATE mysql.user SET Password=PASSWORD('newpassword') WHERE User='root';
FLUSH PRIVILEGES;2. Save the file as mysql-init.txt in c:\ (or any directory you want)
3. Stop MySQL service
4. Start MySQL service in command prompt with this command line
>c:\mysql\bin\mysqld --init-file=c:\\mysql-init.txt
5. Remove the txt file in created in step 2
Note: You can/need to specify correct path for the file and mysql directory for step 2 and 4.
To backup mysql database (all databases) can use this batch file
Then you can compile the .bat file to become .exe file so that the password is hidden.
Download bat to exe converter from CNET download
Lastly, you can include the exe file to run in task scheduler
You can have option to upload the file via FTP to other server
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | :: Start FTP files to remote server :: Create the temporary FTP script file > script.ftp ECHO ftpusername >>script.ftp ECHO ftppassword >>script.ftp ECHO lcd / >>script.ftp ECHO lcd /MySQLBackups/backupfiles >>script.ftp ECHO binary >>script.ftp ECHO prompt n >>script.ftp ECHO put FullBackup.%backupdate%.zip >>script.ftp ECHO bye :: Use the temporary script for unattended FTP :: Note: depending on your OS version you may have to add a '-n' switch FTP -v -s:script.ftp ftphostcom.com :: Overwrite the temporary file before deleting it TYPE NUL >script.ftp DEL script.ftp :: DONE FTP backup file to remote server |
To easily toggle database config for localhost and server, you can simply check whether you are accessing the local or server.
1 2 3 4 5 6 7 8 9 10 11 12 13 | if (preg_match("/localhost/i", $_SERVER['SERVER_NAME'])) { define ('DBHOST','localhost'); define ('DBNAME','localdbname'); define ('DBUSER','localuser'); define ('DBPASS','localpass'); define ('DEV',TRUE); } else { define ('DBHOST','localhost'); define ('DBNAME','serverdbname'); define ('DBUSER','serveruser'); define ('DBPASS','serverpass'); define ('DEV',FALSE); } |
Captcha is good to reduce spam. One of most popular captcha used is recaptcha.
This is how it looks like. Familiar?
To implement it is very easy. Will take less than 10 minutes of your time.
1. Get your public and private key
https://www.google.com/recaptcha/admin/create
2. Include class file
Download recaptcha library file for PHP (with some sample files)
3. Insert code in form page
1 2 3 4 5 6 7 8 | <form method="post" action="verify.php">
<?php
require_once('recaptchalib.php');
$publickey = "your_public_key"; // you got this from the signup page
echo recaptcha_get_html($publickey);
?>
<input type="submit" />
</form> |
4. Insert code to validate code in process page
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | require_once('recaptchalib.php'); $privatekey = "your_private_key"; $resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]); if (!$resp->is_valid) { // What happens when the CAPTCHA was entered incorrectly die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." . "(reCAPTCHA said: " . $resp->error . ")"); } else { // Your code here to handle a successful verification } |
If you are sending out resume to apply for job, please follow the following rules