erikson Posted March 8, 2007 Share Posted March 8, 2007 (edited) hi all i have some questions regards sql so i have a db with 2 fields the first field is the nr.crt ( 1, 2 , 3 etc ) the second field is "free" and contains 1 or 0 i insert this querry $sQuery = "SELECT nr.crt FROM db_name WHERE free='1' " to select get all the fields who contain in the "free" value 1 now all i whant is that i can write somewere this fields example ------------------ nr.crt | free | ------------------ 1 | 1 | ------------------ 2 | 0 | ------------------ 3 | 1 | ------------------ 4 | 1 | ------------------ so i whant to write somewere the fields who contain 1 like : 1 , 3, 4 can anyone tell me if this is possible and how to do it? note thet i used mysql.au3 Edited March 8, 2007 by erikson Link to comment Share on other sites More sharing options...
guwguw Posted March 8, 2007 Share Posted March 8, 2007 hi alli have some questions regards sql so i have a db with 2 fieldsthe first field is the nr.crt ( 1, 2 , 3 etc )the second field is "free" and contains 1 or 0i insert this querry $sQuery = "SELECT nr.crt FROM db_name WHERE free='1' "to select get all the fields who contain in the "free" value 1now all i whant is that i can write somewere this fields example ------------------nr.crt | free |------------------1 | 1 |------------------2 | 0 |------------------3 | 1 |------------------4 | 1 |------------------so i whant to write somewere the fields who contain 1like :1 , 3, 4 can anyone tell me if this is possible and how to do it?It's possible, but which version of SQL are you talking about?MySQL?Microsoft SQL?Oracle?Normally, "nr.crt" would be an illegal field name, because the letters before the dot refer to the name of the database. Link to comment Share on other sites More sharing options...
erikson Posted March 8, 2007 Author Share Posted March 8, 2007 MySQL - 4.0.21-nt Protocol version: 10 with ODBC 3.51 DRIVER Link to comment Share on other sites More sharing options...
ptrex Posted March 8, 2007 Share Posted March 8, 2007 @eriksonThe best way to get started with SQL is looking here :SQL Schoolby the way the link shows you how to do an UPDATE statement need to write something to the DBRegardsptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
erikson Posted March 8, 2007 Author Share Posted March 8, 2007 (edited) @eriksonThe best way to get started with SQL is looking here :SQL Schoolby the way the link shows you how to do an UPDATE statement need to write something to the DBRegardsptrexdude you just don`t understaind what i ask .... for the others i find the solutionCODE$var = _Query($sql,"SELECT * FROM table WHERE free = '1' ")With $varWhile NOT .EOFFileWriteLine("c:\test.txt",.Fields("numar").value & @CRLF).MoveNextWEndEndWithps . i know sql Edited March 8, 2007 by erikson Link to comment Share on other sites More sharing options...
guwguw Posted March 9, 2007 Share Posted March 9, 2007 dude you just don`t understaind what i ask .... for the others i find the solutionCODE$var = _Query($sql,"SELECT * FROM table WHERE free = '1' ")With $varWhile NOT .EOFFileWriteLine("c:\test.txt",.Fields("numar").value & @CRLF).MoveNextWEndEndWithps . i know sqlDoes that mean you solved what you were looking for?Because I read your initial post that you were trying to get a comma separated list of those entries with "free" set to 1 (which your code snippet is close to but not quite there yet).If I'm wrong, try to be a better communicator, please Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now