Jump to content

nadz

Members
  • Posts

    75
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

nadz's Achievements

Member

Member (2/5)

0

Reputation

  1. hmmm, i didnt write the script, i know its terrible coding but the script does look and function nicely. i actually paid $300 for it and this is the only issue i have with it at the moment. Anyway, if there isnt a way to search the whole database is there any way to search at least a full table?
  2. im trying to add an option which allows the user to change their username. Usernames appear in my database in a number of tables under several fields. i thought rather than using UPDATE queries for each field there might be a query that allows me to update all cells in the db where for example the value is "user124". i found this article but im not entirely sure how to use it in php: http://vyaskn.tripod.com/sql_server_search_and_replace.htm im using phpmyadmin if that makes it easier? any help would be appreciated
  3. the title says it all really, im developing a website and using the same template throughout the site, ive ended up making about 6 html files so far, is there anyway i can change the links to each of the page like in the title. so instead of going to http://mysite.com/pagename.htm i can use http://mysite.com/index.php?page=pagename any help would be appreciated
  4. i found this article but im not entirely sure how to use it in php: http://vyaskn.tripod.com/sql_server_search_and_replace.htm
  5. im trying to add an option which allows the user to change their username. Usernames appear in my database in a number of tables under a several fields. i thought rather than using UPDATE queries for each field there might be a query that allows me to update all cells in the db where for example the value is "user124". any help would be appreciated
  6. ive fixed the error, now all the code is right i just need to work out how to use it within my sites header or footer.
  7. hi, thanks for the help guys. im getting this error with the code qbove me. any ideas? Parse error: syntax error, unexpected ')' in /home/.loekie/nexman/D******.co.uk/file/templates_c/%%112%%1125780542_footer.html.php on line 73
  8. Basically i need to select the rows from a table where the user is "$curr_user" and the "seen" field is empty. Then i want to count the rows and use the count in a javascript alert. Heres what i got so far: <?php $result = mysql_query($query = "SELECT * FROM user WHERE user=''.$curr_user.'' AND seen=''") or trigger_error(mysql_error()."<PRE>".$query."</PRE>", E_USER_ERROR); $num = mysql_num_rows($result) if($num > 0) { <script language="Javascript"> alert ("You have $num new messages") </script> } ?> can anyone see whats wrong? any help appreciated
  9. hi, i fixed the issue. thanks alot for your help.
  10. hi thanks, i just realised that and changed it but now im getting "mysql_num_rows(): supplied argument is not a valid MySQL result resource"
  11. hi, ive tried using this code instead but im getting a "Call to undefined function mysql_count_rows()" error. i got everything to work using the old code but i thought id try this if its more efficient.
  12. UPDATE: ive also fixed that problem. sorry, i just took one detailed look at every single line of code and found 2 mistakes. thankyou for the quick replies anyway.
  13. UPDATE: ive got the form to work properly now, but i have another problem. At the bottom of the original form there is "invalid id" -
  14. ok, i am just trying to make a simple form at the moment that logs the users id and name. basically i have a form that asks for the users name and email address, it checks if the email address is registered by checking if there is an "id" present with the email address in my "user" table. I would like it to create an entry in my "crush" table with the users name and id. and if the email address does not match an id it should echo "id incorrect" or the login form. i have this code but it always echoes invalid id, even when i put the right details in: <?php if (!$_POST) { include("form.php"); } $dbhost = 'mysql.d****.co.uk'; $dbuser = 'nextman'; $dbpass = '*****'; $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql'); $dbname = 'main'; mysql_select_db($dbname); $fetch=mysql_fetch_assoc(mysql_query("SELECT `id` FROM `user` WHERE `email`='$email'")); $id = $fetch['id']; $id = isset($_GET['id'])?$_GET['id']:0; if ($id > 0) { $name = $_POST['txtName']; $email = $_POST['txtEmail']; mysql_query("INSERT INTO `crush` (name, id) VALUES ('$name', '$id')"); include("member.php"); } else { echo 'invalid entry id'; } ?>
×
×
  • 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.