Mysql: find wrong emailadres

December 11th, 2008 § 0

SELECT  Email FROM Emails where Email not REGEXP ‘^[A-Z0-9._%+-]+@[A-Z0-9.-]+.[A-Z]{2,4}$’ and Email != “”

PHPMyAdmin: Table specific privileges

November 14th, 2008 § 0

If you like to grant a user special privileges, like for example, only run select queries on a table, then PHPMyAdmin is your friend.

1. Go to the user settings
2. leave the global settings blank
3. under database specific, choose your database.
4. in the table specific, opt for the table you wish to add.
5. in the select column, select all fields that can be used for select queries.
6. check show_view and Create_view

That’s all :)

Adding leading zero’s and id’s with php

October 28th, 2008 § 0

For a project of mine I had to make a dynamic filename
We decided that the name should always be seven digits long and the file would be correspondent  to the line number in the database. For example line seven would link to a file 0000007.txt.

code for the id from MySQL
$mynr = mysql_insert_id();

code for the seven digits
$mynr = sprintf(”%07d”,$mynr);

Related Blogs

  • Related Blogs on

Where Am I?

You are currently browsing entries tagged with MySQL at westworld: a webmasters best friend.