GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 11-Aug-2003, 05:18
zuzupus zuzupus is offline
Junior Member
 
Join Date: Jul 2003
Posts: 70
zuzupus is an unknown quantity at this point

paasing values in fk_t_diectories


function 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  
Old 12-Aug-2003, 02:34
zuzupus zuzupus is offline
Junior Member
 
Join Date: Jul 2003
Posts: 70
zuzupus is an unknown quantity at this point

Re: paasing values in fk_t_diectories


nobody is there for my rescue its very urgent if anybody felt for code then i can paste whole code

thanks in advance
  #3  
Old 12-Aug-2003, 03:54
jrobbio's Avatar
jrobbio jrobbio is offline
Regular Member
 
Join Date: Jan 2003
Location: Loughborough, England
Posts: 840
jrobbio will become famous soon enough
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  
Old 12-Aug-2003, 05:35
zuzupus zuzupus is offline
Junior Member
 
Join Date: Jul 2003
Posts: 70
zuzupus is an unknown quantity at this point
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 there r others too
www.desilva.biz
www.desilva.biz
www.desilva.biz

I hope you understand.

thanks
  #5  
Old 12-Aug-2003, 06:31
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
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!
  #6  
Old 12-Aug-2003, 06:58
zuzupus zuzupus is offline
Junior Member
 
Join Date: Jul 2003
Posts: 70
zuzupus is an unknown quantity at this point
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  
Old 12-Aug-2003, 07:12
zuzupus zuzupus is offline
Junior Member
 
Join Date: Jul 2003
Posts: 70
zuzupus is an unknown quantity at this point

check problem


Hello,

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 GIDBlogWelcome to Baghdad by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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

All times are GMT -6. The time now is 21:57.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.