-
Posts
840 -
Joined
-
Last visited
-
Days Won
1
Everything posted by gristoi
-
pass dynamic text from html in javascript to php?
gristoi replied to unknown00's topic in PHP Coding Help
premiso is right, it should be i not $i. Ive got php on the brain today. My bad -
pass dynamic text from html in javascript to php?
gristoi replied to unknown00's topic in PHP Coding Help
ok, why cant you pass a hidden input type through? +'<input id="nms" name="nms" type="hidden" value="'+nms[$i]+'"/>' -
coding + tired = mistakes
-
pass dynamic text from html in javascript to php?
gristoi replied to unknown00's topic in PHP Coding Help
typo , should be echo $_GET['nms']; and what is the address in the url when you click on the button to post the form -
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']; } ?>
-
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
-
how exactly are you trying to execute the query?
-
pass dynamic text from html in javascript to php?
gristoi replied to unknown00's topic in PHP Coding Help
+'<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]; } -
Reserving a tally - SELECT and UPDATE in one query
gristoi replied to laPistola's topic in MySQL Help
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 -
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
-
where have you declared the constant for EXTRACT_NUMBER ?
-
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());
-
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
-
try buying yourself some anitvirus and a firewall !!!
-
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'");
-
dont forget to click on resolved
-
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'";
-
echo out the email variable and make sure it matches what is in the database
-
its because your not executing your query $updpass="UPDATE `users` SET password='$new_password' WHERE mail='$email'"; mysql_query($updpass);
-
my localhost is a full apache linux server
-
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
-
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."; } } ?>
-
youve got your mail function back to front: $sentmail = mail($to,$subject,$header,$message); should be: $sentmail = mail($to,$subject,$message,$header);