![]() |
|
#1
|
|||
|
|||
paasing values in fk_t_diectoriesfunction foreach_db($name = 'default') {
global $queries; if (!$queries[$name]) return False; $line = mysql_fetch_object($queries[$name][0]); f (++$queries[$name][1] >= $queries[$name][2]) { mysql_free_result($queries[$name][0]); $queries[$name] = False; } return $line; } actually i dont no how to get value for eg $names = array(); SELECT u.name,u.sys_pk FROM t_user u INNER JOIN tr_directories_user r ON r.fk_t_user=u.sys_pk WHERE r.fk_t_directories='517' //how i can pass value thats why i use $r->sys_pk and after this querry while($r = foreach_db()) { $names[$r->sys_pk] = $r; } please guide me how to pass value through querry this is the table t_user CREATE TABLE t_user ( sys_pk int(11) NOT NULL auto_increment, name text, fk_t_directories int(11) NOT NULL default '0', PRIMARY KEY (sys_pk), KEY Key_fk_t_directories (fk_t_directories) ) TYPE=MyISAM; INSERT INTO t_user VALUES (12,'acursora',951); INSERT INTO t_user VALUES (8,'VD',860); INSERT INTO t_user VALUES (11, 'CAD',99); CREATE TABLE tr_directories _user( sys_pk int(11) NOT NULL auto_increment, fk_t_directories int(11) NOT NULL default '0', fk_t_user int(11) NOT NULL default '0', PRIMARY KEY (sys_pk), UNIQUE KEY fk_t_directories (fk_t_directories,fk_t_user), KEY Key_fk_t_directories (fk_t_directories), KEY Key_fk_t_user (fk_t_user)) INSERT INTO t_directories VALUES (12,199,37) INSERT INTO t_directories VALUES (8,111,11) INSERT INTO t_directories VALUES (11,69,11) how i can pass the value in fk_t_directories as i dont want to hard code i used join qerry so that when i select directories from form i can get user name hopefully u understand my situation thanks in advance |
|
#2
|
|||
|
|||
Re: paasing values in fk_t_diectoriesnobody is there for my rescue its very urgent if anybody felt for code then i can paste whole code
thanks in advance |
|
#3
|
||||
|
||||
|
I think me and others would find it more friendly if you described your problem first and what it is you are struggling with first, before shoving code in our faces. I don't know if you realise, but the way you post actually puts me off from responding and I get the feeling that the same is for others.
Another thing is that you have never responded to JDS with a thanks or to tell him if things have worked properly and this I'm sure puts him off from helping you. Remember, we are all here voluntarily and we DO NOT have to give any help, but we do because we enjoy it. I hope you understand. Rob |
|
#4
|
|||
|
|||
|
I think me and others would find it more friendly if you described your problem first and what it is you are struggling with first, before shoving code in our faces. I don't know if you realise, but the way you post actually puts me off from responding and I get the feeling that the same is for others.
<<im sorry for trouble as sometimes i tensed and this doesnt mean that i also want to tensed u guys but most of the times my posted things r not replied properly or sometimes it remains unreplied,i can understand that every post is not going to be reply thats why how come i can give thanks to those posts Another thing is that you have never responded to JDS with a thanks or to tell him if things have worked properly and this I'm sure puts him off from helping you. Remember, we are all here voluntarily and we DO NOT have to give any help, but we do because we enjoy it. << and ur saying that i never say thanks strange i always appreciated people who has given me feedback if there is no response how come i no see these posts which i said thanks www.desilva.biz www.desilva.biz www.desilva.biz I hope you understand. thanks |
|
#5
|
||||
|
||||
|
First of all zuzupus, I for one, appreciate all your posts and questions.
For me at least, it's not a matter of whether a poster takes the trouble to say thanks; that's not what I'd expect usually anyway. But zuzupus, you seriously have to look at how you ask your questions. You probably make your questions appear much more complicated than it needs to be. I for one am busy most of the day and I have problems looking at my own scripts a lot of times. I can handle questions that are to the point and clearly defined but strips of code off a larger, entire application is hard to decipher. Please understand that we usually want to help genuinely but sometimes it's hard to pick up your code the way you present it, that's all! __________________
J de Silva Learning Journal | GIDForums™ | GIDNetwork™ | GIDWebhosts™ | GIDSearch™ |
|
#6
|
|||
|
|||
|
sorry JDK i will take care next time i am sorry for all my wierd posts and i dont no how to appreciate anybody something in forums but i ahev seen lot of ur psots they simply appreciate or say thanks even i do same
anyway i will be careful for next time.i really appreciate for ur sincere help and advice towards me infact i like ur forum honestly thanks and regards |
|
#7
|
|||
|
|||
check problemHello,
actually i got problem in such a simple thing dont no why its not working i have some files which contain HTML and some which dont have HTML's so set boolean to check this if its true then show checked one else show unchecked query_db("SELECT sys_pk, info FROM t_directories"); while($r2 = foreach_db()) { $info [$r2->sys_pk] = $r2->info ; } print_r($info);//this one returns all arrays showing true and false as this info is set as boolean for eg. a file called download which is HTML file this info returns true for this and false for another file called SUCHEN u can see in link server2.vitodesign.com now the problem is :_ showing chekbox true everytime no matter which file u select HTML Info: <td class="black2"><input type="radio" onClick="document.enableform.name.value='<?php echo htmlentities($r->name);if($info) echo "';document.enableform.check.checked='true";?> '"//this condition is always showing true name="ddir" value="<?=$r->sys_pk ?>" id="<?="dir{$r->sys_pk}" ?>" /></td> for ur simplicity i just want to tell u what foreach_db and query_db do function foreach_db($name = 'default') { global $queries; if (!$queries[$name]) return False; $line = mysql_fetch_object($queries[$name][0]); if (++$queries[$name][1] >= $queries[$name][2]) { mysql_free_result($queries[$name][0]); $queries[$name] = False; } return $line; } function query_db($arg, $name = 'default', $errhandling = 'yes') { global $mysql, $queries; $result = mysql_query($arg, $mysql); if ($result) { $numrows = mysql_num_rows($result); $queries[$name] = array($result, 0, $numrows); } else { if ($errhandling <> 'no') { if (expire_header()) { echo "<html >"; <head> expire(); echo " <title>Database Failure</title> </head> <body bgcolor=\"#ffffff\"> "; } echo " <h1>Database Failure</h1> SQL-Database Failure:<br /> Error ".mysql_errno($mysql).": ".htmlentities(mysql_error($mysql))."<br /> </body> </html> "; die(); } else { $numrows = 0; $result = 'no'; } } return ($result == 'no') ? False : True; } i want to show this HTML info: filed checked only when some file contains HTMl else unchecked hope this is clear for everybody thanks |
Recent GIDBlog
Welcome to Baghdad by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| store values | skyloon | MySQL / PHP Forum | 6 | 23-Jul-2005 03:29 |
| getting values | zuzupus | MySQL / PHP Forum | 2 | 07-Aug-2003 04:33 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The