Jump to content

Yohanne

Members
  • Posts

    216
  • Joined

  • Last visited

Everything posted by Yohanne

  1. if there is a selection option for year to show up the following you want. $query_list("SELECT year, quantity, name from BDNAME WHERE year = '$selected_year'"); $query_result = mysql_query($query_list); thin apply from guru suggestion and others.
  2. thank you for all your responce and advice. and earlier from what you said, i check everyline and variable and i notice this $new = new new_request(); instead $new = new new_request_(); Couse->solve Thanks you
  3. please help to define, where couse the error: i foud like this error Fatal error: Call to undefined method new_request::the_suppliment() public function the_suppliment() { foreach($_POST as $key => $values) { $mydata[$key] = $this->cleared($values); } if(isset($mydata['new']) && 'New' == $mydata['new']) { $this->set_query = ("INSERT INTO ocs_item_list(user_id,request,cat_name,prd_name,quantity,date_request) VALUES('$mydata[id]','$mydata[request]','$mydata[cat]','$mydata[subcat],'$mydata[quantity],'$mydata[thedate]')"); $this->var_result = mysql_query($this->get_query()) or die("$this->get_query". mysql_error()); } } } $nnew = new new_request(); $nnew->the_suppliment();
  4. Yohanne

    DISTINCT ID

    i have this "SELECT DISTINCT ocs_admin_new_item.cat_id,ocs_admin_new_item.prd_name,ocs_category.cat_id,ocs_category.cat_name FROM ocs_admin_new_item INNER JOIN ocs_category ON ocs_admin_new_item.cat_id = ocs_category.cat_id ORDER BY prd_name" now how can i DISTINCT the cat_id? where i have two table that i join?
  5. any advice for what would i do? to do not happen it again? what security should i use? or is there i have to change for the security? please help need your all advice
  6. to add your logic simply follow this if you want to get what you want. http://i1323.photobucket.com/albums/u587/jayson_ph/jph_200004_zpsca9519b3.png from above use SELECT DISTINCT AND INNER JOIN
  7. try it. if the user is already in , in secute page you do not need to call this $errflag instead of calling the database parater to show up what you need to show.
  8. ya.. there is. <?php ?>
  9. i really dont know what wrong with it. could please help to find out where i get mistake. Parse error: syntax error, unexpected ',' in line 13 which the line 13 is $Conn = (DB_SERVER_, DB_USER_, DB_PASS_) or die("Server not Conneceted".mysql_error()); define ('DB_SERVER_', 'localhost'); define ('DB_USER_', 'root'); define ('DB_PASS_', ''); define ('DB_NAME_', 'ocs_proton'); class DB_class { public function __construct() { $Conn = (DB_SERVER_, DB_USER_, DB_PASS_) or die("Server not Conneceted".mysql_error()); $X = mysql_connect($Conn); mysql_select_db(DB_NAME_($Conn)) or die("database not connected". mysql_error()); } }
  10. use variable to catch-up your 200 value
  11. use foreach statement/tag
  12. if(isset($_POST['submit']) && 'Submit' == $_POST['submit']) { $post_array = array(); if(empty($_POST['value'])) { $post_array[] = 'text empty value'; } else { $_POST['value'] = mysql_real_escape_string($_POST['value']); } if(sizeof($post_array)> 0) { foreach($post_array as $new_array); echo $new_array; } } hope its help to add your conditional logic.
  13. echo "<option value = ''>Select Category</option>"; echo "<select name = 'cat_name'>"; while($s = mysql_fetch_array($cat_class->get_the_result)) { echo "<option value = $s[cat_id]> $s[cat_name]</option>"; } echo "</select>"; a simple way, to get the record from database using select option, hope its help
  14. so, what, exactly the problem you point out?
  15. its okay for a beginner, to protice procedural coding like you show code above. and try to reconstruct your code or else use other way for insert.
  16. try, other one like xampp it si not totally sensitive.
  17. in your welcome page or home.php you must set session session_start(); if(!isset($_SESSION['username'])) { header("Location:login.php"); exit(); } <p> Welcome : <?php echo $_SESSION['username']; ?></p>
  18. doing good practice to declare variable" class myclass { private $val; function set_val($val) { $this->val = $val; } function get_val() { return $this->$val; } } $newval = new myclass(); $newval->set_val("my name is jayson"); echo $newval->get_val();
  19. create another table, where your temporary file will save as your temporary.
  20. do this. or simply remove else if(!mysql_num_rows($result)) { die("No user found by that username."); }
  21. Hi all, Could you help if what is the correct syntax for this? <a href="javascript:void(0)" onclick = "window.open('newaccount.php?admin32=<?php echo substr(sha1($rows['a_id']),4,30) ?>','','top=60,left=250,right=200,width=300, height=500,menubar=no,alignment=center')">Account</a> and when i remove line below the code is working. ?admin32=<?php echo substr(sha1($rows['a_id']),4,30) ?>
  22. please help...
  23. something like this im doing: <?php if(isset($_GET['tab']) == 'newtab)') { $link = "newtab.php?"; foreach ($_GET as $key => $value) $link .= "$key=$value&we3333"; header("Location:$link"); } ?> <a href="?tab=newtab"><span>New</span></a> and the output is like this: en/newtab.php?tab=newtab&we3333 but sad to say from the (tab=newtab&we3333) is no value mean useless.. and i want every each number or letter is have a value, example i want to remove last number 3 and the page will get page not found!
×
×
  • 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.