Jump to content

gristoi

Members
  • Posts

    840
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by gristoi

  1. premiso is right, it should be i not $i. Ive got php on the brain today. My bad
  2. ok, why cant you pass a hidden input type through? +'<input id="nms" name="nms" type="hidden" value="'+nms[$i]+'"/>'
  3. coding + tired = mistakes
  4. typo , should be echo $_GET['nms']; and what is the address in the url when you click on the button to post the form
  5. you havent executed the query. You need to execute the query to get the resource id THEN use any fetch commands to retrievfe the data. it should look something like this: <?php session_start(); include './includes/mysql/connect.php'; $query = (" SELECT * FROM `forum_cats` AS cats, `forum_subs` AS subs, `forum_topics` AS topics, `forum_replys` AS replys, `users` AS users WHERE subs.cat = cats.name AND topics.sub_cat_id = subs.id AND replys.sub_cat_id = subs.id AND users.username = replys.username ORDER BY cats.id ASC , replys.id DESC ") ; $result = mysql_query($query) or die(mysql_error()); while ($row = mysql_fetch_array($result)){ // output the results . ie $row['item1']; } ?>
  6. ok, can you post complete example of a query you are trying to execute. Its a bit hard trying to help you when we cant see what can be causing the issue. there is only so much I can guess at
  7. how exactly are you trying to execute the query?
  8. +'<form action="index.php?nms='+nms[$i]+'" method="post" enctype="multipart/form-data">'+ then on your php: if(isset($_POST['delbutton'])=='Delete') { echo("into the php delete: " . $_POST['name2'] . "<br />\n"); echo '<pre>' . print_r($_POST,true) . '</pre>'; echo $_GET[''nms]; }
  9. you could have a look at using a mysql trigger. These basically listen for an event that you want and perform an action when needed. For example it will listen for an insert into table A and will update table B accordingly: user uploads file and record is inserted into evidence trigger sees insert and incriments that users tally http://dev.mysql.com/doc/refman/5.0/en/triggers.html
  10. you have a unique or primary key field in your database called name. And you are trying to insert a value that is already in the database
  11. where have you declared the constant for EXTRACT_NUMBER ?
  12. why have you got two %% at the end of your query? try: $query = mysql_query("SELECT musictitle FROM music WHERE musictitle LIKE '%Set Fire To The Rain%'") or die(mysql_error());
  13. It is a matter of maths. If you had, for example, 6 queries that perform a set of tasks compared against 1 query that returns the same results as the 6, then you had 100 hits per second on your site executing the queries on that page then you would end up with 600 calls to the database compared to 100. So scale that up and imagine how much impact that would have on your server. Take thorpes good advice and look up on joins
  14. have a look at using the array_rand function.
  15. try buying yourself some anitvirus and a firewall !!!
  16. What error?
  17. what was it you said? :" i have 2 problems" lol: mysql_query("DELETE from `pass_reset` WHERE 'confirm_code='$confirmation'"); should be mysql_query("DELETE from `pass_reset` WHERE `confirm_code`='$confirmation'");
  18. dont forget to click on resolved
  19. thisnk ive found your problem: $selectkey="SELECT * FROM $table1 WHERE confirm_code =$confirmation'"; you have a ' after confirmation. should be: $selectkey="SELECT * FROM $table1 WHERE confirm_code ='$confirmation'";
  20. echo out the email variable and make sure it matches what is in the database
  21. its because your not executing your query $updpass="UPDATE `users` SET password='$new_password' WHERE mail='$email'"; mysql_query($updpass);
  22. my localhost is a full apache linux server
  23. did you look at the code i just posted? I added an if else loop around your query, saying if email does not exist then show error, else email
  24. do you mean something like this? <?php $host="localhost"; // Host name $username="fustigat_lol"; // Mysql username $password="lol123"; // Mysql password $db_name="fustigat_phoenix"; // Database name //Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect to server"); mysql_select_db("$db_name")or die("cannot select DB"); $email=$_POST['email']; $tbl_name=users; $sql="SELECT mail FROM $tbl_name WHERE mail='$email'"; $result=mysql_query($sql); if(mysql_num_rows($result)== 0) { echo 'You did not submit a valid email'; } else { $query_user="SELECT username FROM $tbl_name WHERE mail='$email'"; $user=mysql_query($query_user); $confirmation=md5(uniqid(rand())); $hotel_name=Hotel; // Email $to=$email; $subject="Password Reset - $hotel_name"; $header="From: [email protected]\r\n"; $message="Your confirmation link\r\n"; $message.="Click on this link to to have a password sent to you\r\n"; $message.="http://fustigate.net/confirmation.php?code=$confirmation"; $sentmail = mail($to,$subject,$message,$header); if($sentmail){ echo "Thank you $user, a confirmation link has been sent to your email."; } } ?>
  25. youve got your mail function back to front: $sentmail = mail($to,$subject,$header,$message); should be: $sentmail = mail($to,$subject,$message,$header);
×
×
  • 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.