Jump to content

marcelobm

Members
  • Posts

    57
  • Joined

  • Last visited

Contact Methods

  • Website URL
    http://marcelobm.com, marcelobm.wordpress.com

Profile Information

  • Gender
    Not Telling

marcelobm's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. it seems like your query is not returning any rows, try to do this if(mysql_num_rows($query)){ $query_result = mysql_result($query,0); echo <<<OPT <meta http-equiv="REFRESH" content="0;url=http://www.mysite.com/view.php?id={$query_result}"> OPT; }else{ echo 'no records found'; }
  2. the query i posted will return all employees from a specific location that hasn't attended the specific course, but you can add SELECT table_1.* FROM table_1 LEFT JOIN table_2 ON table_1.emp_number = table_2.emp_number WHERE location = 'locaction' AND (course_title != 'title' OR course_title IS NULL); and that should give you what you are looking for.
  3. When you do // Update db for last login $id_mem = $_SESSION['id_mem']; // <<< SESSION member id has a value here because it's used in the redirect below $ip = $_SERVER['REMOTE_ADDR']; // Get ip address of person logging in $q = "UPDATE sn_members SET last_login = Now(), ip = '$ip' WHERE id_mem = '$id_mem' LIMIT 1"; $r = mysqli_query ($dbc, $q) or trigger_error("Query: $q\n<br />MySQL Error: " . mysqli_error($dbc)); it updates the database as expected? i mean if when you use $_SESSION['id_mem'] it returns the right value
  4. In this INSERT Statement you are passing 15 column names and only 11 column values, it must be the same $sql = mysql_query("INSERT INTO members (id, username, password, realname, phone, email, address, city, state, zip, country, accounttype, bio, resume, signupdate) VALUES('$username','$realname', '$address','$city','$state','$zip','$country','$accounttype','$email','$hashedPass', now())") or die (mysql_error()); for example INSERT INTO members (username, password, realname, phone, email, address, city, state, zip) VALUES ('$username', '$password', '$realname', '$phone', '$email', '$address', '$city', '$state', '$zip') Same number of parameters in the same order.
  5. try this $query_result = mysql_result($query,0); echo <<<OPT <meta http-equiv="REFRESH" content="0;url=http://www.mysite.com/view.php?id={$query_result}"> OPT;
  6. You can only use column aliases in GROUP BY, ORDER BY, or HAVING clauses
  7. probably this will work SELECT table_1.* FROM table_1 LEFT JOIN table_2 ON table_1.emp_number = table_2.emp_number WHERE location = 'locaction' AND course_title != 'title'; But anyways I think you should rethink the way your database is made.
  8. var uri = hash_value.split("/"); var page = uri[1] ? uri[1] : ''; var user_id = uri[2] ? uri[2] : ''; var page2 = uri[3] ? uri[3] : '';
  9. you probably are giving the div a height in the css, instead set it to min-height
  10. One of the problems i see right away is that when you implode the values, you need to do it so values are separated by a comma
  11. Because when you do $bar = "My name is $bar"; it replaces the contents of $bar, if you would like to echo Bob my name is it should be like this $bar .= "My name is"; or $bar = $bar." My name is";
  12. The reason it outputs "My name is Bob" is because when you assign $foo to $bar you are doing it with an & before the var name &$foo this means that $bar will be a reference to $foo instead of another var with foo's value, therefore any change you make to bar it's done actually for $foo.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.