Jump to content

GD77

Members
  • Posts

    108
  • Joined

  • Last visited

Everything posted by GD77

  1. usually this error happens if you have empty table... nothing to be returned
  2. Totally agree with ChristianF just wanted to see if we can save time with this well back to coding each table's requirements. I'll keep the post open in case anyone got any idea. Thanks again everyone.
  3. ChristianF you re right about complex things... yet m not giving this sections to users it s for my back-end as small cms to control the data. I'll try to simply it more and yes they all are class functions ... -Let s say you have 7 or 20 tables and you want to insert data in each table I m talking about 100-1500+ row of data and each table has no less then 25 columns... instead of coding the insert form and validation for each table manually M trying to do it dynamically. -So far I ve made class functions to retrieve tables names then select each table's columns then make a form with < input > for each entry... -Now here where I m stuck validating each entry for each table dynamically one function to validate all entries from any table, what if I wanted to add another table or 10 do I ve to recode each table validation? this is it. jesirose this is where I m now
  4. Already I ve coded that section and It select the requested table, generate a form based on each table's columns only facing the validation
  5. You re right did not notice the before, ok i ll explain more: Let s say you ve created new table along with existing ones... instead coding new validation rules for each newly created table you ll have one function able to do so... so far can t manage it and facing to manually recode validation for each new table... :/
  6. yes I m opened to all alternatives and this is the code nothing more: function tst() { foreach.... }
  7. you are right and m not going to use but when I need to set a variables as globals multiple vars what s wrong with my code so it s not doing it?
  8. trying to achieve a newsletter layout? as been said just generate the page and email it as link or use phpmailer to email the whole page yet it wil be big so emailing the link like a newsletter will be wiser.
  9. Hello: Trying to make variables global inside a function dynamically: foreach($_POST as $ke => $val) { $$ke= trim($_POST[$ke]); global $$ke; } then I call that function inside another one to be used the global... not working how to fix it plz. Thanks
  10. Hello: I've made a function to retrieve columns from a DB and output an input tag for each returned value in order to insert new data... I've reached the validation process :/ how to validate input without making validation function for each table just want it to be dynamic if possible... function Data_Fetch($tbls) { $qry_tbl=mysql_query("SELECT COUNT( * ) FROM `information_schema`.`TABLES` WHERE (`TABLE_NAME` LIKE '%".$tbl."%')"); $qry_Resutl=mysql_result($qry_tbl,0); if($qry_Resutl==0){ echo "TABLE NOT AVAILBLE!!!"; }else{ $tbls=mysql_real_escape_string($tbls); $qry_Fields=mysql_query("SELECT * FROM `".$tbls."` ORDER BY `id` ASC"); $i = 0; print_r("<form name='form_tbl_insert' method='post' target='_self' class='form_tbl_insert'><table class='tbl_insert'>"); while ($i < mysql_num_fields($qry_Fields)) { $col = mysql_fetch_field($qry_Fields, $i); $value_Insert=$_POST[$col->name]; if(isset($value_Insert)) {$value_Insert1=$value_Insert;}else{$value_Insert1="";} if (!$col) {print_r( "No information available<br />");exit;} if($col->name!=='id'){ print_r("<tr><td>".$i."</td><td>".$col->name."</td><td><input type='text' name='".$col->name."' value='".$value_Insert1."'>".$col->type." ".$col->max_length."</td></tr>"); }//END if not id $i++; }//END while print_r("<tr><td> </td><td> </td><td><button type='submit'>Insert Data</button></td></tr></table></form>"); mysql_free_result($qry_Fields); }//END else }/*END Fn Data_Fetch*/
  11. ya I saw it was a normal array not associative :/
  12. @Barand: want it to be selective not whole data... you should be able to select what you need...
  13. this is what m trying to achieve: $fetch_T=mysql_fetch_assoc($qry_T); print_r (."$fetch_T['2']['1'].");
  14. Hello: How to get specific value of specific key? $tst=array(0=>array('val1','val2'), 1=>array('val3','val4')); like val4 from key 1 or val 2 from key 0. Thanks.
  15. Hello: I have the following object code that should be re-sized as per content using css: <object name="" class="xxx" data="page.php" type="all"></object> I have tried clear:both, overflow, on the tag nothing is working... Thanks in advanced.
  16. GD77

    Loader

    just simple when ever you have long php codes being parsed you can post a msg like wait or smtg just without the use of JS or ajax... would it be possible?....
  17. GD77

    Loader

    any content you want to load mainly php codes that takes time to be parsed....
  18. GD77

    Loader

    Hello: Been trying for a long to make or find a way to code a loader, PHP loader without ajax, JS or what ever just pure PHP anyone got an idea if it s possible of anyone found a solution? Thanks.
  19. fixed with: '~([(\d]{3}){1}([(\d)]{1}){1}([(\d)]{3}){1}([(\d)]{3}){1}$~', '$1-$2-$3-$4',.... but I m using ([(\d)]{3}){1} twice should not that be replaced with ([(\d)]{3}){2}? :/ anyway here how I ve fixed it http://www.functions-online.com/preg_replace.html online test still don t egt it why ~ delimiter is obligatory in it :/
  20. Hello: I'm using the following to format a number: $ne=1113444555 $v1=substr($ne, 0,3)."-".substr($ne, 3,1)."-".substr($ne, 4,3)."-".substr($ne, 7); result: 111-3-444-555 Trying with preg_replace... not working well since I can find the match but not successful in converting it: $v1=preg_replace('/(([(\d]{3}){1}([(\d)]{1}){1}([(\d)]{3}){2})/', '$1-$2-$3-$4', $ne);
  21. Thanks, than I ll drop it i ll find other way.
  22. any other method to access all variables inside pg() but not every var inside the class like $tst ? class Misc { public $t1,$t2,$tst; function pg() { $qry=mysql_query("..."); $fetch_pg=mysql_fetch_assoc($qry) ; $this->t1=$fetch_pg['...']; $this->t2=$fetch_pg['...']; foreach($this as $var => $value) { echo "$var: $value<br>"; } //return true; } }/*END class user_Related*/ $misc=new Misc(); echo $misc->pg();
  23. hanks a lot, worked like a charm
  24. use <object> instead of iframe you wont face errors on validating the page and you don t have to use the scrollbar propertie so you wont get error on Opera when u use css instead to control it
  25. Hello, I m using the following fuction to calculate the time difference between 2 stops...Working well till I ve noticed when one of the stops was am the second was pm I got -987 as result:/ function timeDiff($T_old, $T_new) { $timeCalc = strtotime($T_new) - strtotime($T_old); $timeCalc = round($timeCalc/60); return $timeCalc; } $res=$this->timeDiff($fetch_LA_time, date("h:i:s"));
×
×
  • 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.