Jump to content

nadz

Members
  • Posts

    75
  • Joined

  • Last visited

    Never

Everything posted by nadz

  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'; } ?>
  15. hi, i got it all sorted. the code was right i was pointing it to the wrong table thanks anyway
  16. sorry i didnt explain myself properly, i know how to use the mail function and ive got it all set up but im having trouble displaying any of the details from the form and database. the email that the message is sent to is fetched from the database using a supplied id number to find it. for example, http://site.com/page.php?id=32 will email the message to the address of the user with id 32. $fetch=mysql_fetch_assoc(mysql_query("SELECT `email` FROM `crush2` WHERE `id`='$id'")); $email = $fetch['email']; if(mail ($email, $emailsubject, $body, "From: your site <crushreply@****.co.uk>")) include("crush/done.php"); my problem is that it doesnt email it to the address it grabs, in fact it doesnt fetch the address. can anyone see any errors in my code.
  17. basically i have a form on my page that the users fill out. i would like all the details submitted to the form to be emailed to the user. there are four fields and id like the email to look like this: Your name: Your details 1: Your details 2: Your details 3: i have the form ready and at the moment it stores the details in a mysql database, but id like to change it to email everything to the user instead. any help would be appreciated.
  18. hi, thanks for your help. i tried it and it echoed "$id" so i put an extra pair of single quotes around it and it worked. like this: if(!isset($_GET['id'])) { echo "no id supplied" }else { $id = $_GET['id']; } if(isset($id)) { echo ''.$id.''; } ?>
  19. hi, basically i'd like my users to be able to give their friends a link like this: ww.mysite.com/index.php?id=[users id number] and id like to use the id number supplied in a mysql query on the page. in abit more detail, the page contains a form , the friend fills the form in and the contents are logged in a database so it can be viewed by the user who sent the link. i already have the link output ready thanks to some members in another thread, but i need to know how to make the page pick up the id. this is what i got so far: <?php if(!isset($id)) { echo "no id supplied"; } if(isset($id)) { echo '$id'; } ?> unfortunately it echoes "no id supplied" even when i give an id.
  20. hi, thankyou all for your help. ive got it working - it prints the id now. thanks again
  21. ive got this code in howto.php: <a href="http://mysite.com/page.php?id=$id">copy this link and send it to your friends</a> but i want it to output like this: <a href="http://mysite.com/page.php?id=[the users id number]">copy this link and send it to your friends</a>
  22. ok, this is how the code looks now: mysql_query("INSERT INTO `crush2` (name, email, password) VALUES ('$name', '$email', '$password')"); $id = mysql_insert_id(); include("howto.php"); but it still displays $id insted of the id number. maybe ive got the code wrong in the link. do i need square brackets around $id in howto.php?
  23. hi again. turns out im having some problems displaying the id number in the page. here is the code im using for the query and grabbing the id number mysql_query("INSERT INTO `crush2` (name, email, password) VALUES ('$name', '$email', '$password')"); $id = $row["id"]; include("howto.php"); : ive got this code in howto.php: <a href="http://mysite.com/page.php?id=$id">copy this link and send it to your friends</a> but it doesnt replace $id with the id from the database ???
  24. thanks for the help guys. its much appreciated. the db has a field now that has the id number in it.
×
×
  • 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.