echo " Step 1. Insert data
"; $sql = "INSERT INTO users (name,city,web,age) VALUES ('Tom','Vegas','www.tom.com',5)"; if ($result){ echo "Data was inserted! "; } else { echo "An error occured during insert! "; } .", City:".$row['city'].", Age:".$row['age']." "; } echo " Step 2. Update data
"; $sql = "UPDATE users SET age=45 WHERE name='Tom'"; if ($result){ echo "Data was updated! "; } else { echo "An error occured during update! "; } .", City:".$row['city'].", Age:".$row['age']." "; } echo " Step 3. Remove data
"; $sql = "DELETE FROM users WHERE name='Tom'"; if ($result){ echo "Data was removed! "; } else { echo "An error occured during remove! "; } .", City:".$row['city'].", Age:".$row['age']." "; } ?>
This blog aim is to provide support to all It and Telecom related professional in the form of books,article,howtos etc.
Sunday, January 30, 2011
MySQL PHP Exampler
Saturday, January 29, 2011
Asterisk Voice Prompts
you can download asterisk voice prompts in different language using the following link.
http://downloads.asterisk.org/pub/telephony/sounds/
http://downloads.asterisk.org/pub/telephony/sounds/
Wednesday, January 26, 2011
MsSQL dump to remote server
was running out of disk space on a server today. The server had a large database table that was no longer used, so I wanted to archive it and then drop the table. But the server didn’t have enough disk space to dump it out to disk before copying it off to a remote server for archiving.
The first thought was to run mysqldump dump on the destination machine, and to access the database over the network. That however, doesn’t compress or encrypt the data. Plus I would have had to create a mysql user with permission to access the database remotely.
The solution I came up with worked out well: mysqldump directly to the remote host with this command:
That pipes the mysqldump command through gzip, then to through and SSH connection. SSH on the remote side runs the ‘cat’ command to read the stdin, then redirects that to the actual file where I want it saved.
The first thought was to run mysqldump dump on the destination machine, and to access the database over the network. That however, doesn’t compress or encrypt the data. Plus I would have had to create a mysql user with permission to access the database remotely.
The solution I came up with worked out well: mysqldump directly to the remote host with this command:
mysqldump [mysqldump options] | gzip -c | ssh user@remotehost "cat > /path/to/some-file.sql.gz"
That pipes the mysqldump command through gzip, then to through and SSH connection. SSH on the remote side runs the ‘cat’ command to read the stdin, then redirects that to the actual file where I want it saved.
Subscribe to:
Posts (Atom)