View Single Post
ישן 09-05-07, 10:34   # 2
בניה
משתמש - היכל התהילה
 
מיני פרופיל
תאריך הצטרפות: Oct 2005
מיקום: נחושה
הודעות: 3,434

בניה לא מחובר  

הצורה בכלל שאתה עובד איתה היא לא טובה.
תעשה ככה:

PHP קוד:
<?php
$name
=$_request['name'];
$link mysql_connect('localhost''''');
if (!
$link) {
    die(
'Could not connect: ' mysql_error());
}
$db_selected mysql_select_db('neri');
if (!
$db_selected) {
    die(
'Could not select database: ' mysql_error());
}
$query "SELECT name FROM `users` WHERE name = '{$name}' LIMIT 1";
$result mysql_query($query);
if (!
$result) {
    die(
'Query failed: ' mysql_error());
}

if(
mysql_num_rows($result) > 0)
    die(
"pick a new name");
mysql_free_result($result);
?>
  Reply With Quote