Foser Posted August 9, 2007 Share Posted August 9, 2007 I made a script for a friend and one my wamp server it works fine but on his server he gets this messge: Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in register.php on line 14 <?php // Includes! require('includes/mysql.php'); session_start();?> <?php if (isset($_POST['reg_submit'])){ $user = mysql_real_escape_string($_POST['reg_user']); $pw = md5($_POST['reg_pw']); $email = $_POST['reg_email']; $location = $_POST['reg_location']; $webpage = $_POST['reg_url']; $avatar = $_POST['reg_avatar']; $check_username_valid = mysql_query("SELECT * FROM user_info WHERE username = '{$user}'"); if (mysql_num_rows($check_username_valid) >= 0){ // line 14 mysql_query("INSERT INTO user_info (username,password,email,location,url,avatar_url) VALUES ('$user','$pw','$email','$location','$webpage','$avatar')"); header("Location: regf.php?user={$user}"); } else { echo "Username is already in use."; exit; }} ?> Link to comment https://forums.phpfreaks.com/topic/64046-solved-works-on-one-server-error-on-the-other/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.