Re: [PHP] Making a Variable from different tables with Matching Dbfields?

2009-01-29 Thread Terion Miller
Hi Guys! Well I tried the INNER JOIN and still can not get it to echo the AdminID so I know it isn't working, (what kind of things should I think about that could make it not work) so far the only query that did work and return the AdminID was my original I believe it was referred to as hosed

Re: [PHP] Making a Variable from different tables with Matching Dbfields?

2009-01-29 Thread Shawn McKenzie
Terion Miller wrote: Hi Guys! Well I tried the INNER JOIN and still can not get it to echo the AdminID so I know it isn't working, (what kind of things should I think about that could make it not work) so far the only query that did work and return the AdminID was my original I believe it

Re: [PHP] Making a Variable from different tables with Matching Dbfields?

2009-01-29 Thread Terion Miller
Hi Again Here is the query and code I tried: $sql = SELECT * FROM workorders WHERE AdminID = (SELECT AdminID FROM admin WHERE UserName = ' . mysql_real_escape_string($_SESSION['user']) . '); $result2 = mysql_query ($sql); $row2 = mysql_fetch_assoc ($result2); $printrow =

Re: [PHP] Making a Variable from different tables with Matching Dbfields?

2009-01-29 Thread Shawn McKenzie
Terion Miller wrote: Hi Again Here is the query and code I tried: $sql = SELECT * FROM workorders WHERE AdminID = (SELECT AdminID FROM admin WHERE UserName = ' . mysql_real_escape_string($_SESSION['user']) . '); $result2 = mysql_query ($sql); $row2 = mysql_fetch_assoc

Re: [PHP] Making a Variable from different tables with Matching Dbfields?

2009-01-29 Thread Terion Miller
Well upon looking it was number 2, I had no orders in the workorder table, but here is an oddity I wonder if someone can explain if I run this simple query: $query = SELECT * FROM admin, workorders WHERE admin.UserName = '.$_SESSION['user'].' ; It returns adminID = 7 (my number is

Re: [PHP] Making a Variable from different tables with Matching Dbfields?

2009-01-29 Thread Shawn McKenzie
Terion Miller wrote: Well upon looking it was number 2, I had no orders in the workorder table, but here is an oddity I wonder if someone can explain if I run this simple query: $query = SELECT * FROM admin, workorders WHERE admin.UserName = '.$_SESSION['user'].' ; It returns

Re: [PHP] Making a Variable from different tables with Matching Dbfields?

2009-01-29 Thread Shawn McKenzie
Shawn McKenzie wrote: Terion Miller wrote: Well upon looking it was number 2, I had no orders in the workorder table, but here is an oddity I wonder if someone can explain if I run this simple query: $query = SELECT * FROM admin, workorders WHERE admin.UserName =

Re: [PHP] Making a Variable from different tables with Matching Db fields?

2009-01-28 Thread Andrew Ballard
On Wed, Jan 28, 2009 at 3:18 PM, Terion Miller webdev.ter...@gmail.com wrote: Not sure if I'm wording this right, what I am trying to do is look in two tables, match the ID to use to pull information Here's my code but it's not right, although it is picking up the user from the session, I

Re: [PHP] Making a Variable from different tables with Matching Db fields?

2009-01-28 Thread Terion Miller
Well I'm stuck I have the AdminID but now I can't seem to use it to pull workorders with that AdminID . I couldn't get your block to work Andrew :( I think I'm just not using it right now that I have it...lol On Wed, Jan 28, 2009 at 2:26 PM, Andrew Ballard aball...@gmail.com wrote: On Wed,

Re: [PHP] Making a Variable from different tables with Matching Db fields?

2009-01-28 Thread Christoph Boget
Well I'm stuck I have the AdminID but now I can't seem to use it to pull workorders with that AdminID . I couldn't get your block to work Andrew :( I think I'm just not using it right now that I have it...lol Because there is ambiguity w/r/t the columns you are selecting, you'll need to use

Re: [PHP] Making a Variable from different tables with Matching Db fields?

2009-01-28 Thread Terion Miller
I just read it 3 times and I don't understand it. On Wed, Jan 28, 2009 at 3:22 PM, Christoph Boget christoph.bo...@gmail.comwrote: Well I'm stuck I have the AdminID but now I can't seem to use it to pull workorders with that AdminID . I couldn't get your block to work Andrew :( I think

Re: [PHP] Making a Variable from different tables with Matching Db fields?

2009-01-28 Thread Andrew Ballard
On Wed, Jan 28, 2009 at 4:22 PM, Christoph Boget christoph.bo...@gmail.com wrote: Well I'm stuck I have the AdminID but now I can't seem to use it to pull workorders with that AdminID . I couldn't get your block to work Andrew :( I think I'm just not using it right now that I have it...lol

Re: [PHP] Making a Variable from different tables with Matching Db fields?

2009-01-28 Thread Andrew Ballard
On Wed, Jan 28, 2009 at 4:31 PM, Terion Miller webdev.ter...@gmail.com wrote: On Wed, Jan 28, 2009 at 3:22 PM, Christoph Boget christoph.bo...@gmail.com wrote: Well I'm stuck I have the AdminID but now I can't seem to use it to pull workorders with that AdminID . I couldn't get your block

Re: [PHP] Making a Variable from different tables with Matching Db fields?

2009-01-28 Thread Shawn McKenzie
Terion Miller wrote: Well I'm stuck I have the AdminID but now I can't seem to use it to pull workorders with that AdminID . I couldn't get your block to work Andrew :( I think I'm just not using it right now that I have it...lol On Wed, Jan 28, 2009 at 2:26 PM, Andrew Ballard

Re: [PHP] Making a Variable from different tables with Matching Db fields?

2009-01-28 Thread Christoph Boget
Because there is ambiguity w/r/t the columns you are selecting, you'll need to use aliases. http://dev.mysql.com/doc/refman/5.1/en/identifiers.html In your code, when you are referencing the column, do so using the alias. That should solve your problem. I just read it 3 times and I

Re: [PHP] Making a Variable from different tables with Matching Dbfields?

2009-01-28 Thread Shawn McKenzie
Shawn McKenzie wrote: Terion Miller wrote: Well I'm stuck I have the AdminID but now I can't seem to use it to pull workorders with that AdminID . I couldn't get your block to work Andrew :( I think I'm just not using it right now that I have it...lol On Wed, Jan 28, 2009 at 2:26 PM,

Re: [PHP] Making a Variable from different tables with Matching Dbfields?

2009-01-28 Thread Terion Miller
On Wed, Jan 28, 2009 at 3:43 PM, Shawn McKenzie nos...@mckenzies.netwrote: Shawn McKenzie wrote: Terion Miller wrote: Well I'm stuck I have the AdminID but now I can't seem to use it to pull workorders with that AdminID . I couldn't get your block to work Andrew :( I think I'm just

Re: [PHP] Making a Variable from different tables with Matching Dbfields?

2009-01-28 Thread Shawn McKenzie
Terion Miller wrote: On Wed, Jan 28, 2009 at 3:43 PM, Shawn McKenzie nos...@mckenzies.netwrote: Shawn McKenzie wrote: Terion Miller wrote: Well I'm stuck I have the AdminID but now I can't seem to use it to pull workorders with that AdminID . I couldn't get your block to work Andrew :( I

Re: [PHP] Making a Variable from different tables with Matching Dbfields?

2009-01-28 Thread Terion Miller
On Wed, Jan 28, 2009 at 4:00 PM, Shawn McKenzie nos...@mckenzies.netwrote: Terion Miller wrote: On Wed, Jan 28, 2009 at 3:43 PM, Shawn McKenzie nos...@mckenzies.net wrote: Shawn McKenzie wrote: Terion Miller wrote: Well I'm stuck I have the AdminID but now I can't seem to use it to

Re: [PHP] Making a Variable from different tables with Matching Dbfields?

2009-01-28 Thread Terion Miller
On Wed, Jan 28, 2009 at 4:12 PM, Terion Miller webdev.ter...@gmail.comwrote: On Wed, Jan 28, 2009 at 4:00 PM, Shawn McKenzie nos...@mckenzies.netwrote: Terion Miller wrote: On Wed, Jan 28, 2009 at 3:43 PM, Shawn McKenzie nos...@mckenzies.net wrote: Shawn McKenzie wrote: Terion

Re: [PHP] Making a Variable from different tables with Matching Dbfields?

2009-01-28 Thread Shawn McKenzie
Here are my variables when I reveal them, I am picking up the right adminID I can't figure out why it's returning random orders though: $querySELECT admin.AdminID, workorders.AdminID FROM admin, workorders WHERE admin.UserName = 'tmiller' $result Resource id #5 $row key

Re: [PHP] Making a Variable from different tables with Matching Dbfields?

2009-01-28 Thread Chris
Here are my variables when I reveal them, I am picking up the right adminID I can't figure out why it's returning random orders though: $querySELECT admin.AdminID, workorders.AdminID FROM admin, workorders WHERE admin.UserName = 'tmiller' Please please please trim your posts to relevant

Re: [PHP] Making a Variable from different tables with Matching Dbfields?

2009-01-28 Thread Terion Miller
I'm not sure what you mean by trim the posts, please explain so I can spare folks from redundant text. Your post made perfect sense to me about the INNER JOIN , I looked it up but it is not returning the AdminID, maybe my syntax is wrong? $query = SELECT admin.AdminID , workorders.AdminID

Re: [PHP] Making a Variable from different tables with Matching Dbfields?

2009-01-28 Thread Chris
Terion Miller wrote: I'm not sure what you mean by trim the posts, please explain so I can spare folks from redundant text. Before you post, remove any text that you're not referencing (in this case I removed my suggestion). Your post made perfect sense to me about the INNER JOIN , I

Re: [PHP] Making a Variable from different tables with Matching Dbfields?

2009-01-28 Thread Terion Miller
Your post made perfect sense to me about the INNER JOIN , I looked it up but it is not returning the AdminID, maybe my syntax is wrong? $query = SELECT admin.AdminID , workorders.AdminID FROM admin INNER JOIN workorders ON AdminID(admin,

Re: [PHP] Making a Variable from different tables with Matching Dbfields?

2009-01-28 Thread Chris
Well I tried both ways and still cannot get it to pick up the AdminID, $query SELECT admin.AdminID , workorders.AdminID FROM admin INNER JOIN workorders on AdminID WHERE admin.UserName = 'tmiller' $result $row $SortBy WorkOrderID DESC $Page 1 $PerPage30 $StartPage 0 $sql

Re: [PHP] Making a Variable from different tables with Matching Dbfields?

2009-01-28 Thread Shawn McKenzie
Terion Miller wrote: Your post made perfect sense to me about the INNER JOIN , I looked it up but it is not returning the AdminID, maybe my syntax is wrong? $query = SELECT admin.AdminID , workorders.AdminID FROM admin

Re: [PHP] Making a Variable from different tables with Matching Dbfields?

2009-01-28 Thread Chris
The main problem is that you've never explained what you want to get from the query. The replies have used your code as an example and I'm pretty sure that's not what you want. Unless I totally mis-understand what you want, you have 2 options: 1. Use the 2 queries that I gave you in a

Re: [PHP] Making a Variable from different tables with Matching Dbfields?

2009-01-28 Thread Shawn McKenzie
Chris wrote: The main problem is that you've never explained what you want to get from the query. The replies have used your code as an example and I'm pretty sure that's not what you want. Unless I totally mis-understand what you want, you have 2 options: 1. Use the 2 queries that I

RE: [PHP] Making a variable

2001-02-26 Thread Dan Olsen
you can concatentate the variable inside the foreach loop. foreach (file("$file.txt") as $line) { $data .= ("" . trim(str_replace("'", "''", $line)) . "\n"); } -Original Message- From: Clayton Dukes [mailto:[EMAIL PROTECTED]] Sent: Monday, February 26, 2001 8:17 AM To: [EMAIL

Re: [PHP] Making a variable

2001-02-26 Thread Clayton Dukes
Thanks! - Original Message - From: "Dan Olsen" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, February 26, 2001 11:39 AM Subject: RE: [PHP] Making a variable you can concatentate the variable inside the foreach loop. foreach (file("$file.txt"

Re: [PHP] Making a variable -Trim output

2001-02-26 Thread Clayton Dukes
Thanks again, Is there a way I can tell it to print all but the first 13 lines and the last two lines of the text file? -Clayton - Original Message - From: "Dan Olsen" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, February 26, 2001 11:39 AM Subject: RE: [PHP] Making

RE: [PHP] Making a variable -Trim output

2001-02-26 Thread Dan Olsen
.= $arrayoflines[i]; } } you’ll have to debug, but it should work. DanO -Original Message- From: Clayton Dukes [mailto:[EMAIL PROTECTED]] Sent: Monday, February 26, 2001 8:43 AM To: Dan Olsen; [EMAIL PROTECTED] Subject: Re: [PHP] Making a variable -Trim output Thanks again

Re: [PHP] Making a variable -Trim output

2001-02-26 Thread Clayton Dukes
Dan... You are the man, thanks! :-) - Original Message - From: "Dan Olsen" [EMAIL PROTECTED] To: "Clayton Dukes" [EMAIL PROTECTED] Sent: Monday, February 26, 2001 12:30 PM Subject: RE: [PHP] Making a variable -Trim output clayton- the only pro