Jump to content

saviola

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

About saviola

  • Birthday 03/20/1987

Contact Methods

  • Website URL
    http://stsdb.com

Profile Information

  • Gender
    Male
  • Location
    Bulgaria

saviola's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi all, i'm a little confused. I try to doing some bitwise manipulations, but came across the following strange phenomenon: I try to do something like this : $x = 1; $x = $x >> 31; echo $x * pow(2,4); The output is 0 and $x = 1; $x = $x >> 33; echo $x * pow(2,4); The output is 0 but $x = 1; $x = $x >> 32; echo $x * pow(2,4); The output is 16 I am not very familiar with bit operations , so can anyone help with some expolanation? Thanks advance! P.S. OS Win Xp 32bits , PHP Version 5.2.13
  2. No isn't because you check boxed 3 records... what is the result of query ? Maybe it's empty? Even with one result function mysql_fetch_assoc($res) working. I think you don't return result. Did you see how you can buid and get values of group of check boxes and execut query for more than one rows? It's in my previous post.
  3. Also can try this : function cleanData(&$str) { $str = preg_replace("/\t/", "\\t", $str); $str = preg_replace("/\r?\n/", "\\n", $str); if(strstr($str, '"')) $str = '"' . str_replace('"', '""', $str) . '"'; } // file name for download $filename = "website_data_" . date('Ymd') . ".xls"; header("Content-Disposition: attachment; filename=\"$filename\""); header("Content-Type: application/vnd.ms-excel"); $flag = false; // execute the query $result = mysql_query("SELECT * FROM tableName ORDER BY columnName") or die('Query failed!'); while(false !== ($row = mysql_fetch_assoc($result))) { if(!$flag) { // display field/column names as first row echo implode("\t", array_keys($row)) . "\n"; $flag = true; } array_walk($row, 'cleanData'); echo implode("\t", array_values($row)) . "\n"; }
  4. Maybe something like this : if($_POST["submitMyForm"]) { $checked = implode(", ", $_POST["cb"]); echo $query = "SLECT * FROM table WHERE id IN($checked)"; } <form id="myform" method="POST" action=""> <input type="checkbox" name="cb[]" value="1"> <input type="checkbox" name="cb[]" value="2"> <input type="checkbox" name="cb[]" value="3"> <input type="checkbox" name="cb[]" value="4"> <input type="checkbox" name="cb[]" value="5"> <input type="submit" name="submitMyForm" value="Export"> </form>
  5. $childNum = array(); function getPar($array, &$childNum) { foreach ( $array as $key => $value ) { if( $value['parent'] ) { if ( !isset($childNum[$value['parent']]) || !$childNum[$value['parent']] ) { $childNum[$value['parent']] = 1; } else { $childNum[$value['parent']]++ ; } } } return $childNum; } print_r(getPar($arr, $childNum));
  6. echo "<pre>"; print_r($array);
  7. I saw also this spelling error. Shouldn't be $tbl_namer=cpdUsr; , because in // Insert data into database $sql="INSERT INTO $tbl_name(confirm_code, username, password)VALUES('$confirm_code', '$myusername', '$mypassword')"; $result=mysql_query($sql); you use $tbl_name
  8. I'm not sure, but i think the problem comes from the fact you're not define a variable $error at the beginning of the script. When there are no mistakes, it does not exist (not defined), and you do check whether it is an array. Define the variable $error at the beginning of the script : .... ..... //but if they do not, this code simulates magic quotes if( !get_magic_quotes_gpc() ) { if( is_array($_POST) ) $_POST = array_map('addslashes', $_POST); } $error = array(); ........... .......... and verification changes of : ..... ..... //we need to make sure the order total was calculated before using the submit button if( empty($_POST["Amount_To_Pay"]) ) $error["no_qty"] = "Please go back and calculate your order total and resubmit."; if(count($error) ) { echo "An error occurred while processing your order."; ....... .......
  9. This is will be something like that : <form method="POST" action="index.php" > 1: <input type="checkbox" name="cid[]" value="1"> 2: <input type="checkbox" name="cid[]" value="2"> 3: <input type="checkbox" name="cid[]" value="3"> 4: <input type="checkbox" name="cid[]" value="4"> 5: <input type="checkbox" name="cid[]" value="5"> 6: <input type="checkbox" name="cid[]" value="6"> <input type="submit" name="GO"> </form> <?php if($_POST["GO"]) { $cid = $_POST["cid"]; foreach ( $cid as $id ) { echo "<br>".$id; } } ?> The SQL query can be generated on this way : $checkedColors = "('".implode("'),('", $cid)."')"; $sql = "INSERT INTO `mytable` (colors) VALUES $checkedColors"; [attachment deleted by admin]
  10. Hi, you can find some examples and tutorials here : http://www.zftutorials.com http://devzone.zend.com/public/view http://fedecarg.com/wiki/zfdomain/ http://www.phpeveryday.com/articles/Zend-Framework-Basic-Tutorial-P840.html and of course http://framework.zend.com/docs/overview. But you must be careful about not actual information.
×
×
  • 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.