Problem with 'OR' statement
Could someone have a look at this syntax and give me some guidance what I may be overlooking? SELECT * from $TableName WHERE machinename != 'FIND_ME' OR machinename != 'OPEN' I can make the statement work individually, but when I try to add the 'OR' statement it fails to 'remove' the designated records from the display page. I have tried moving the 'FIND_ME' and 'OPEN' around and still get the same results. Any help would be appreciated Jess --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.558 / Virus Database: 350 - Release Date: 1/2/04 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: Free software to design forms and report
Well, I know you stated that you do not find M$ Access all that good, but you could use Access as a GUI Front end to the MySQL backend. Just a thought. If you are looking at doing that, I suggest you read up on MyODBC since that is what is needed to get the two to talk to each other. I have done this just to see how it is done and it seems to work 'ok'. I still do most of my front end stuff in PHP though. -Original Message- From: Kwok Wee Chi [SMTP:[EMAIL PROTECTED] Sent: Thursday, January 08, 2004 5:43 AM To: [EMAIL PROTECTED] Subject: Free software to design forms and report Hi, I am a new to MySQL. Would like to find out if there is any free software out in the market to design forms and report that links to MySQL. I am looking at a local database, forms and report. Used to work with MS Access, but find that it is not that good. Just got to know MySQL, so would like to test out this portion, if it is better then can forget about MS Access. Rgds, Wee Chi --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.558 / Virus Database: 350 - Release Date: 1/2/04 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.558 / Virus Database: 350 - Release Date: 1/2/04 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: What is my DB Server name?
With what little info you presented allow me to try and answer this one: $db_server: I am assuming that the script you are using is a premade one that can handle different types of database backends, if this is the case, you will need to look at the documentation that came with the script to see what parameters it is looking for. $db_host: This is the name of the server, typically 'localhost' (without quotes). is used. $db_name: pretty self explanatory, this is the name of the database being used $db_user: This is one of the users that you should have set up for the server (preferably not root). Hope this helps. Jess -Original Message- From: jlfx mailgroups [SMTP:[EMAIL PROTECTED] Sent: Friday, December 26, 2003 6:10 AM To: [EMAIL PROTECTED] Subject: What is my DB Server name? Howdy Gang, I am trying to install an image gallery utilizing mysql. It needs the following info: Where do i find this? $db_servertype, $db_host, $db_name, $db_user. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.553 / Virus Database: 345 - Release Date: 12/18/03 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.553 / Virus Database: 345 - Release Date: 12/18/03 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Help with JOIN and Record Display
This being the first time I have tried to do a JOIN statement (and still not yet fully understanding it). If someone could take a look at the below code and see what I may be doing wrong. I have the actual code working and it displays the information from $TableName2.notes, however in this table there are three records that are being displayed (which it should) however it displays them all together. i.e. DISPLAYED This is the first record This is the second record This is the thirdrecord /DISPLAYED What I am wanting it to do is: DISPLAYED This is the first record This is the second record This is the thirdrecord /DISPLAYED Here is the code I am using SNIPPET $Link = mysql_connect($Host, $User, $Password); $Query=SELECT * from $TableName1 LEFT JOIN $TableName2 ON ($TableName1.id = $TableName2.id) WHERE $TableName1.id=1; $Result= mysql_db_query ($DBName, $Query, $Link); while ($Row = mysql_fetch_array ($Result)){ print ($Row[notes]); } /SNIPPET I have even tried putting a line break (\n) in at the end of the $Row[notes] to see if that would do anything which it did not. Thanks in advance for any possible assistance Jess --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.550 / Virus Database: 342 - Release Date: 12/9/03 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: RESOLVED - Help with JOIN and Record Display
I managed to figure out where I was going wrong (or at least I think I have. I was playing around with the syntax and decided to add a BR after the $Row[notes] and it displayed the records line by line. I don't know if this was the best way to do it but it worked. Thanks Jess -Original Message- From: Hunter, Jess [SMTP:[EMAIL PROTECTED] Sent: Sunday, December 14, 2003 11:34 AM To: [EMAIL PROTECTED] Subject: Help with JOIN and Record Display This being the first time I have tried to do a JOIN statement (and still not yet fully understanding it). If someone could take a look at the below code and see what I may be doing wrong. I have the actual code working and it displays the information from $TableName2.notes, however in this table there are three records that are being displayed (which it should) however it displays them all together. i.e. DISPLAYED This is the first record This is the second record This is the thirdrecord /DISPLAYED What I am wanting it to do is: DISPLAYED This is the first record This is the second record This is the thirdrecord /DISPLAYED Here is the code I am using SNIPPET $Link = mysql_connect($Host, $User, $Password); $Query=SELECT * from $TableName1 LEFT JOIN $TableName2 ON ($TableName1.id = $TableName2.id) WHERE $TableName1.id=1; $Result= mysql_db_query ($DBName, $Query, $Link); while ($Row = mysql_fetch_array ($Result)){ print ($Row[notes]); } /SNIPPET I have even tried putting a line break (\n) in at the end of the $Row[notes] to see if that would do anything which it did not. Thanks in advance for any possible assistance Jess --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.550 / Virus Database: 342 - Release Date: 12/9/03 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.550 / Virus Database: 342 - Release Date: 12/9/03 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.550 / Virus Database: 342 - Release Date: 12/9/03 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Another Brickwall with Displaying using JOIN
OK, Have another small issue that maybe someone could help me out with. When using a JOIN I can pull records from a second table without a problem (now). I am wanting to display two fields ( id and notes) however I only want the id field to display once and all the notes to be displayed. Here is the syntax I am trying to use: SNIPPET $Query=SELECT * from $TableName2 LEFT JOIN $TableName1 ON ($TableName2.id = $TableName1.id) WHERE $TableName2.initials='jlh'; $Result= mysql_db_query ($DBName, $Query, $Link); while ($Row = mysql_fetch_array ($Result)){ print (ID: $Row[id] - $Row[technotes]BR\n); } /SNIPPET Which produces this display ID: 1 - This is the first record ID: 1 - This is the second record ID: 1 - This is the third record In the end I want to have it displayed as such: ID: 1 This is the first record This is the second record This is the third record Any and all help would be appreciated Jess --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.550 / Virus Database: 342 - Release Date: 12/9/03 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
How to keep multiple instances of the same information from being displayed
Using PHP as the front end I am creating a form with a dropdown box that displays information from one table to be inserted into another table. That's PHP and I have gotten that part down with no issue. However, in the table a person could be listed multiple times and I only want a user to be listed a single time. for instance in the table I may have Jones, Jim Jones, Mary Jones, Mary Jones, Mary Jones, Nancy Jones, Paul when I do my SELECT I only want Mary Jones to show up a single time. Here is the code I am currently using within the Dropdown box: SNIPPET $Link = mysql_connect($Host, $User, $Password); $Query=SELECT * from $TableName ORDER BY userlastname; $Result= mysql_db_query ($DBName, $Query, $Link); while ($Row = mysql_fetch_array ($Result)){ print (option value='$Row[userlastname], $Row[userfirstname]'$Row[userlastname], $Row[userfirstname]/option); } mysql_close ($Link); ? /SNIPPET As you can see I am pulling two fields from one table, then combining them to make a single field in another table. I am doing this to provide continuity when I create queries in the future. Any help with this would be greatly appreciated Jess --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.550 / Virus Database: 342 - Release Date: 12/9/03 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: How to keep multiple instances of the same information from b eing displayed
Jeff, The first example worked perfectly, Thanks for the quick response Jess -Original Message- From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED] Sent: Friday, December 12, 2003 10:02 AM To: Hunter, Jess Subject: Re: How to keep multiple instances of the same information from being displayed Using DISTINCT will solve your problem SELECT DISTINCT userlastname, userfirstname FROM TABLE ORDER BY userlastname You could get this all out at once also by using CONCAT_WS **untested sql** SELECT DISTINCT CONCAT_WS(', ', userlastname, userfirstname) FROM TABLE ORDER BY userlastname HTH Jeff Hunter, Jess [EMAIL PROTECTED]To: [EMAIL PROTECTED] RC.ORG cc: Subject: How to keep multiple instances of the same information from being 12/12/2003 10:47 displayed AM Using PHP as the front end I am creating a form with a dropdown box that displays information from one table to be inserted into another table. That's PHP and I have gotten that part down with no issue. However, in the table a person could be listed multiple times and I only want a user to be listed a single time. for instance in the table I may have Jones, Jim Jones, Mary Jones, Mary Jones, Mary Jones, Nancy Jones, Paul when I do my SELECT I only want Mary Jones to show up a single time. Here is the code I am currently using within the Dropdown box: SNIPPET $Link = mysql_connect($Host, $User, $Password); $Query=SELECT * from $TableName ORDER BY userlastname; $Result= mysql_db_query ($DBName, $Query, $Link); while ($Row = mysql_fetch_array ($Result)){ print (option value='$Row[userlastname], $Row[userfirstname]'$Row[userlastname], $Row[userfirstname]/option); } mysql_close ($Link); ? /SNIPPET As you can see I am pulling two fields from one table, then combining them to make a single field in another table. I am doing this to provide continuity when I create queries in the future. Any help with this would be greatly appreciated Jess --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.550 / Virus Database: 342 - Release Date: 12/9/03 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.550 / Virus Database: 342 - Release Date: 12/9/03 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.550 / Virus Database: 342 - Release Date: 12/9/03 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
strange warning when using an IF statement
I keep getting the following error when I try to run an if statement Warning: 2 is not a valid MySQL-Link resource in then give the filename Here is what I am trying to do. if ($bumpnumber4) { print (display this); }else { print (display that); } mysql_close ($Link); Anyone have any idea what I may be doing wrong? TIA Jess --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.550 / Virus Database: 342 - Release Date: 12/9/03 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Finding information in the last record
Being real new to MySQL I am having difficulty finding information on how to retrieve data from the last record in a database. I have tried using the SELECT LAST_INSERT_ID() statement but that only works on a per connection basis and doesn't help all the times. Basically I want to goto the end of file and pull the data from a particular field (sku) from the last record/row. If anyone could point me in the right direction I would appreciate it Jess --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.530 / Virus Database: 325 - Release Date: 10/22/03 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]