Jump to content

jazzman1

Staff Alumni
  • Posts

    2,713
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by jazzman1

  1. Yes guys, that's exactly I wanted to say to him, but..... my expression in English is not like yours
  2. Aha, now I've got it. He doesn't make the differences between require_once('header.php') and header("Location: .")
  3. Okay, in this case post all related code.
  4. 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.
  5. Have you tried dumping the contents of $row?
  6. I just want to show him the current result of $1d_arr.
  7. 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']); }
  8. Keep learning and come back later again.
  9. 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; }
  10. Have you included cf_dbConnect() in the script ?
  11. Have you tried dumping the page variable? After first a curly bracket put in - alert (page) .
  12. @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.
  13. jazzman1

    HELPPP

    I use Urban Dictionary -> http://www.urbandictionary.com/define.php?term=dunno
  14. Do you get any sql errors, and if so what errors do you get? Replace die('Error, query failed') with die(mysql_error())
  15. You want to record a file as binary, right ? What type the content column is ?
  16. No problem
  17. I think, you must use windex server is better than linex
  18. It's a pretty cool img_bar.php file. I'm going to use it in the future
  19. You spelled it wrong - linex != linux. If your project is deployed on linux server, you can use only "\n".
  20. No problem.
  21. Are you sure ? $pass = "password"; $passMd5 = md5('password'); if(!$passMd5 == md5($pass)){ var_dump($passMd5); } else { var_dump(false); }
  22. 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); }
  23. 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
  24. Move the post to the right place, please! Yes, it works with aliasing, but.... why ?
  25. @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 )
×
×
  • 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.