jazzman1
Staff Alumni-
Posts
2,713 -
Joined
-
Last visited
-
Days Won
12
Everything posted by jazzman1
-
Yes guys, that's exactly I wanted to say to him, but..... my expression in English is not like yours
-
Redirect to different page after successful login
jazzman1 replied to mds1256's topic in PHP Coding Help
Aha, now I've got it. He doesn't make the differences between require_once('header.php') and header("Location: .") -
Okay, in this case post all related code.
-
I really want to help you, but if you don't have an idea how ajax works, you could start to learn some tutorial on the web.
-
Redirect to different page after successful login
jazzman1 replied to mds1256's topic in PHP Coding Help
Have you tried dumping the contents of $row? -
I just want to show him the current result of $1d_arr.
-
Did you see the result before to pass it to the array_push ? You need to iterate it in the loop : while($row=mysql_fetch_array($result)){ echo '<pre'.print_r($1d_arr, true).'</pre>'; exit; array_push($1d_arr[$row['letter']], $row['num']); }
-
Redirect to different page after successful login
jazzman1 replied to mds1256's topic in PHP Coding Help
Keep learning and come back later again. -
Redirect to different page after successful login
jazzman1 replied to mds1256's topic in PHP Coding Help
Your code is a little bit messy. Have you got a real user name ? Put this code inside the while loop: while($row = mysqli_fetch_object($query)) { echo '<pre>'.print_r($row, true).'</pre>'; exit; $_SESSION['firstName'] = $row->firstName; } -
Redirect to different page after successful login
jazzman1 replied to mds1256's topic in PHP Coding Help
Have you included cf_dbConnect() in the script ? -
Have you tried dumping the page variable? After first a curly bracket put in - alert (page) .
-
@gwpaul, I've just written a very simple script to you, how to insert multiple values into DB. Take a look at the example: // array containing data $array = array( 'name' => array("John", "Abbi", "Barbara"), 'email' => array("j.doe@intelligence.gov", "abbi@gmail.com", "barbara@yahoo.ca"), 'created_at' => array("2011-08-13", "2012-01-11", "2012-05-05") ); // build query... $sql = "INSERT INTO `tbl_name`"; // implode keys of $array... $sql .= " (`" . implode("`, `", array_keys($array)) . "`) VALUES"; // loops values of // multiple Dimensional Arrays $i = 0; while ($i < count($array)): $sql .="("; foreach ($array as $value) { $sql .= "'" . $value[$i] . "',"; } // trim the last comma from a query string $sql = rtrim($sql, ','); $i++; $sql .= "),"; endwhile; // trim the last comma from a query string $sql = rtrim($sql, ','); echo '<pre>' . print_r($sql, true) . '</pre>'; // proper output // INSERT INTO `tbl_name` (`name`, `email`, `created_at`) VALUES('John','j.doe@intelligence.gov','2011-08-13'),('Abbi','abbi@gmail.com','2012-01-11'),('Barbara','barbara@yahoo.ca','2012-05-05') // execute query... $result = mysql_query($sql) or die(mysql_error()); If you don't understand something, don't hesitate to asк in the forum.
-
I use Urban Dictionary -> http://www.urbandictionary.com/define.php?term=dunno
-
Do you get any sql errors, and if so what errors do you get? Replace die('Error, query failed') with die(mysql_error())
-
You want to record a file as binary, right ? What type the content column is ?
-
It's a pretty cool img_bar.php file. I'm going to use it in the future
-
Are you sure ? $pass = "password"; $passMd5 = md5('password'); if(!$passMd5 == md5($pass)){ var_dump($passMd5); } else { var_dump(false); }
-
I think this logic is wrong. Simple example: // incorrect $pass = "password"; $passMd5 = md5('password'); if(!$passMd5 == md5($pass)){ var_dump($passMd5); } // correct $pass = "password"; $passMd5 = md5('password'); if($passMd5 == md5($pass)){ var_dump($passMd5); } //correct $pass = "password"; $passMd5 = md5('password'); if(!$passMd5 != md5($pass)){ var_dump($passMd5); }
-
No, I think the query and output now is more readable and flexible using aliases and fetch_assoc. By the way, I wanted to post my questions to this topic -> http://forums.phpfreaks.com/index.php?topic=363624.15
-
Move the post to the right place, please! Yes, it works with aliasing, but.... why ?
-
@scootstah, I think, fetch_assoc and fetch_row works if you want to retrieve a data only from one table. What about this? Ps. Sorry wrong place :'( $query = "SELECT `cities`.`Name` ,`countries`.`Name` FROM `cities` LEFT JOIN `countries` ON `cities`.`CountryCode` = `countries`.`Code` WHERE `cities`.`ID` = 10"; $result = mysql_query($query); while ($row = mysql_fetch_array($result)) { echo '<pre>'.print_r($row, true).'</pre>'; } // output Array ( [0] => Tilburg [Name] => Netherlands [1] => Netherlands ) $query = "SELECT `cities`.`Name` ,`countries`.`Name` FROM `cities` LEFT JOIN `countries` ON `cities`.`CountryCode` = `countries`.`Code` WHERE `cities`.`ID` = 10"; $result = mysql_query($query); while ($row = mysql_fetch_assoc($result)) { echo '<pre>'.print_r($row, true).'</pre>'; } // output Array ( [Name] => Netherlands )