CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.

YesSoftware Forums -> CodeCharge Studio -> PHP

 database connections

Print topic Send  topic

Author Message

Posted: 07/18/2015, 12:00 PM

I have a registration page with a username field and on the username field I have beforeshow

but not sure if I am doing it correctly

function checkuser() {
$username= $_POST['username'];
$sql = mysql_query("select user_id from users where soldier='$username");
echo 'Taken.';
echo 'OK';
View profile  Send private message

Posts: 639
Posted: 07/18/2015, 2:55 PM

You can use the required Unique attribute in the field properties or write your own validation using a query like:

$db = new clsDBConnection1();

$SQL = "SELECT user_id from users WHERE username = '$username'";

if($user_id > 0){
$Container->Errors->addError("Username Taken");


Central Coast, NSW, Australia.

View profile  Send private message

Add new topic Subscribe to topic   

These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

Home   |    Search   |    Members   |    Register   |    Login

Powered by UltraApps Forum created with CodeCharge Studio
Copyright 2003-2004 by  and YesSoftware, Inc.