[PHP-DB] Re: pg_fetch_result returns something other than boolean???
Matthew Newby wrote: > I am having trouble with the pg_fetch_result function when trying to access > a boolean field in a PostgreSQL database. Here's the code snippet: It's a spec. PostgresSQL's boolean is returned as 't' or 'f' and both are string. Test as string. -- Yasuo Ohgaki -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Upload csv file into mysql
try phpMyAdmin - nice and easy, although i'm pretty sure there is a direct command line. // -Original Message- // From: Dr. Indera [mailto:[EMAIL PROTECTED]] // Sent: Wednesday, 4 September 2002 12:21 PM // To: [EMAIL PROTECTED] // Subject: [PHP-DB] Upload csv file into mysql // // // Hello, // // Is there a way to upload data in a csv file into a mysql table? // // Thanks // Indera // // // // -- // PHP Database Mailing List (http://www.php.net/) // To unsubscribe, visit: http://www.php.net/unsub.php // -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Upload csv file into mysql
Hello, Is there a way to upload data in a csv file into a mysql table? Thanks Indera -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Help with making a class or connect function
I got it to work My problem was I didn't put include in function. So the class file should be like this link = mysql_pconnect($sqlhost,$sqluser,$sqlpasswd); if (!$this->link) { printf("Could not connect to sql server"); } mysql_select_db($sqldatabase); }//end of function connect }//end of class ?> than to call the link I just did. $class = new Connect; $class->link; So anybody want more info on how to use this class I made email me at [EMAIL PROTECTED] cheers :) "Frank Mancuso" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi I made this. > > //config.php > $sqlhost = "localhost"; > $sqluser = "root"; > $sqlpasswd = "password"; > $sqldatabase = "project"; > ?> > > //sqlclass.php > require('config.php'); > class Connect { > > var $link; > > > function Connect() { > > $this->link = mysql_connect($sqlhost,$sqluser,$sqlpasswd); > $select = mysql_select_db($sqldatabase,$this->link); > > } > > } > > ?> > > > //index.php > require('config.php'); > require('sql.php'); > > > $class = new Connect; > > > $query = "SELECT * from houses WHERE city='toronto'"; > > $result = mysql_query($query,$class->link); > > $row = mysql_fetch_array($result); > > echo "$row[title]" > ."$row[firstname]"; > > ?> > > > > What I'm trying to do is make a function or class that I can call up when > ever I want to connect to mysql. > If anyone can explain if I've done something wrong or if I'm not calling the > function up. > > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: mysql_connect
try this. - Original Message - From: "Bryan McLemore" <[EMAIL PROTECTED]> Newsgroups: php.db To: "PHP LIST" <[EMAIL PROTECTED]> Sent: Tuesday, September 03, 2002 9:27 PM Subject: mysql_connect I'm trying to connect using the sample code in the php documentation. IT however dies every time. If someone could please help me? Thanks. Bryan -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: mysql_connect
In article <000c01c253b2$506d7530$0101a8c0@fwcmain>, [EMAIL PROTECTED] says... > I'm trying to connect using the sample code in the php documentation. IT however >dies every time. If someone could please help me? Thanks. > > Bryan > Can you show the code you are using, and any error messages you get? -- David Robley Temporary Kiwi! Quod subigo farinam -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] External file integryti check
can't you just make the name of the file include a unique identifier of some sort, or store each user's files in a different directory or something, to make sure that they can't overwrite each other's (or their own) files? Or would that not work in your app? HTH Beau // -Original Message- // From: Miguel Carvalho [mailto:[EMAIL PROTECTED]] // Sent: Tuesday, 3 September 2002 5:35 PM // To: [EMAIL PROTECTED] // Subject: [PHP-DB] External file integryti check // // // Hi, id'like to know the opinion about to ensure external // file integrity. // // Scenario: A web application that uses binary files( images, PDF's ). // On the database ( postgresql 7.2.2 ) i store the filename of // the files. // // The files ( images only ) are taken from an internal machine // when needed( // via ftp ) or automatically at idle periods.If the image // comes throuth ftp( requested by a user ), // the image is downloaded to a temporary directory, a record // is inserted // into the database and the file get's moved to the final // directory if it // passed some tests.If no image is requested by a user, a // script will download( rcp ) at night // the files and then put those in the final directory.When a // user request's a PDF, i create the PDF in realtime, using info. // stored in the DB plus the image( store on filesystem ). // My concern here is the folowing: // let's imagine that an image file is overwriten with a new image( by // mistake ). This is possible because users use some kind of // ID to name // the file. If this appens, the info stored in DB is out of sync in // relation to the file stored in filesystem. // To correct this issues i have three possibilities: // // 1 - Store the PDF's in the filesystem, and store the // file date, time // andCRC32 of the entire file in the database. This // solution has a // consequence... i will need lots of space in the server( // each file is // aprox. 2MB ). At night a script will validate the // sync between the info stored in // DB and the info on filesystem. // 2 - Create the PDF when requested. When the PDF generated for the // first time, i will store: image creation date, time, // crc32 and some // more dates, times and CRC32's of other information into // the DB. At night a script will validate the sync // between the info stored in // DB and the info on filesystem. // 3 - Run a script that is change file permissions( file // is created with // user owner of webserver) for those new records inserted // to root. A script will be run, because i cant change // ownership of a file on // the fly with PHP( PHP security ). // Those are my solution's, if any one has any comments or suggestion's // please share it with us.Thank's // Miguel Carvalho // // // // -- // PHP Database Mailing List (http://www.php.net/) // To unsubscribe, visit: http://www.php.net/unsub.php // -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] mysql_connect
I'm trying to connect using the sample code in the php documentation. IT however dies every time. If someone could please help me? Thanks. Bryan
RE: [PHP-DB] Indepth Tutorial... need help.
I must concur, Chapters 28 & 29 are worth the price of the book! =C= * * Cal Evans * The Virtual CIO * http://www.calevans.com * -Original Message- From: Ignatius Reilly [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 03, 2002 9:49 AM To: [EMAIL PROTECTED]; Matt Zur Subject: Re: [PHP-DB] Indepth Tutorial... need help. For a SQL tutorial, I would recommend that you get yourself a copy of Joe Celko's "SQL for smarties". Best investment I ever made. Everything you need to know is there. Bon courage! - Original Message - From: "Matt Zur" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, September 03, 2002 3:08 PM Subject: Re: [PHP-DB] Indepth Tutorial... need help. > Right well that's what I'm asking I need a tutorial and haven't found a > good one. > > -Matt > > Rasmus Lerdorf wrote: > > Most of this stuff is actually just SQL and has little to do with PHP. So > > look for an SQL tutorial. From the PHP side all you need to know is > > mysql_connect(), mysql_select_db(), mysql_query() and mysql_fetch_row().'' > > > > All queries are sent to the database via mysql_query(). It doesn't matter > > to PHP if you are adding, deleting, modifying, searching, sorting, > > filtering, or whatever. You just put the SQL code in the mysql_query() > > call. > > > > -Rasmus > > > > On Tue, 3 Sep 2002, Matt Zur wrote: > > > > > >>Can someone point me in the direction of an online tutorial for php > >>mysql that covers the following: > >> > >>- Teaches me how to use php to access mysql > >>- Creating a db that is structured to be efficient > >>- How to add, modify, and delete records in a database > >>- How to search for records > >>- How to filter records > >>- How to sort records, by a certain field, alphabetical, descending etc. > >>- Indexes - how to create them, how to keep the updated with changes in > >>the db a beginners look to in-depth approach. > >> > >>Yes I've visited PHP.net, and mysql.com. I need a dumbed down version > >>that pretty much holds my hand and is very detailed. I've searched the > >>net for a while now, and all the tutorials I have found... although > >>simple... they don't go in-depth and move on to more advanced features. > >> > >>Any help at all will be greatly appreciated. > >> > >>-Matt > >> > >> > >>-- > >>Matt Zur > >>[EMAIL PROTECTED] > >>http://www.zurnet.com > >> > >>Need a Web Site??? - Visit... www.zurnet.com > >> > >>1997 - 2002 - 5th Anniversary!!! > >> > >> > >>-- > >>PHP Database Mailing List (http://www.php.net/) > >>To unsubscribe, visit: http://www.php.net/unsub.php > >> > > > > > > > -- > Matt Zur > [EMAIL PROTECTED] > http://www.zurnet.com > > Need a Web Site??? - Visit... www.zurnet.com > > 1997 - 2002 - 5th Anniversary!!! > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: problems whenever changing data in database using PHPMyAdmin.
I do have the same problem since I did update to the newest version of phpmyadmin. This seems to be a bug in the new release since everything was working ok before the update. guess those guys are gonna release a .1 version pretty soon. andy "Kasper" <[EMAIL PROTECTED]> schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > ... I was wondering for quiete a while about the subject to get it accurat > enough concerning the problem I'm really having. > > I have my MySQL database runing, my site is running and fetching the data > from the database without any problems. I can access PHPMyAdmin without any > problems aswell, I can browse my tables and the entries of the tables. > But whenever I try to make any changes to my table, or to an entry, or if I > try to rename a table, or create a new table, I get the "The Page Cannot Be > Displayed"-404-error - why is that??? And why does this error only occur > when I'm altering the database?? > > Is it a read-only-no-writting-problem?? is it a setting that does that > PHPMyAdmin can't find the database to alter my changes?? If so, why can I > brose the database and see all my entries and the content of the database?? > > > Looking forward in getting some response. > > Kasper > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Indepth Tutorial... need help.
These should be helpful: http://zc8.net/zc8/shownews.php?articleid=93 http://zc8.net/zc8/shownews.php?articleid=95 http://zc8.net/zc8/shownews.php?articleid=98 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Help with making a class or connect function
Hi I made this. link = mysql_connect($sqlhost,$sqluser,$sqlpasswd); $select = mysql_select_db($sqldatabase,$this->link); } } ?> link); $row = mysql_fetch_array($result); echo "$row[title]" ."$row[firstname]"; ?> What I'm trying to do is make a function or class that I can call up when ever I want to connect to mysql. If anyone can explain if I've done something wrong or if I'm not calling the function up. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Looking for php/MSsql consultant
We are developing Web applications on Red Hat 7.3, Apache (latest), PHP (latest), Microsoft sql (latest) to display customer, inventory, and order pages. Looking for very strong PHP consultant experienced with MS sql to help with knotty problems. Near Los Angeles or Pacific Time Zone is a plus. Please contact Jim Workman at [EMAIL PROTECTED] (Including your hourly rate help.) -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] INSERTing INTO Multiple Tables with MySQL & PHP
Hi there, I've been hunting thru the net trying to find some info on inserting data to multiple tables. I have two tables (LookupTable and MainTable): LookupTable( FirstID SecondID ) MainTable( ID Name Address etc etc ) Once I insert data into the MainTable I want to also insert the ID from the MainTable to the LookupTable as the FirstID. Then I want to check for the highest ID number in the SecondID field that is associated with the First ID then add one to the highest value and insert that to the SecondID. FirstID SecondID 1 1 1 2 1 3 1 4 In the above table I would want to insert 1 to the FirstID then find the highest number in the SecondID associated with the FirstID "1" then add one to it so that my next row in the table would be: FirstID SecondID 1 5 How would I go about doing this? I've been looking thru Kevin Yank's book "Build Your Own Database Driven Website Using PHP & MySQL", its pretty good on the whole but updating two tables simultaneously seems to be lacking detail. I hope I've made this clear enough, I may have repeated myself there but I was wanted to make sure that what I've written is cleary understood. Thank you in advance for any help - I'm lost! Graeme :) Public Sub House() On Error Resume drink If Pint.empty = True Then Pint.refill Else Pint.drink End if stomach.add Pint MsgBox " I've had " & stomach.count & " Pints" MsgBox "VERY DRUNK" End Sub -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Indepth Tutorial... need help.
I'd endorse "SQL for Smarties", plus just about anything else JC has written on SQL. Another good book is "The Practical SQL Handbook" by Bowman, Emerson & Darnovsky, ISBN 0-202-44787-8 For a tutorial have a look at Julie Meloni's at http://www.thickbook.com. They are "single issue" tutorial, aredevloped progressively and quite clear. A new user must read the section of the manual which deals with variables. The way PHP creates variables automatically can be a bit confusing to the newcomer. Hope this helps - Miles Thompson At 04:49 PM 9/3/2002 +0200, Ignatius Reilly wrote: >For a SQL tutorial, I would recommend that you get yourself a copy of Joe >Celko's "SQL for smarties". >Best investment I ever made. Everything you need to know is there. > >Bon courage! > > >- Original Message - >From: "Matt Zur" <[EMAIL PROTECTED]> >To: <[EMAIL PROTECTED]> >Sent: Tuesday, September 03, 2002 3:08 PM >Subject: Re: [PHP-DB] Indepth Tutorial... need help. > > > > Right well that's what I'm asking I need a tutorial and haven't found a > > good one. > > > > -Matt > > > > Rasmus Lerdorf wrote: > > > Most of this stuff is actually just SQL and has little to do with PHP. >So > > > look for an SQL tutorial. From the PHP side all you need to know is > > > mysql_connect(), mysql_select_db(), mysql_query() and >mysql_fetch_row().'' > > > > > > All queries are sent to the database via mysql_query(). It doesn't >matter > > > to PHP if you are adding, deleting, modifying, searching, sorting, > > > filtering, or whatever. You just put the SQL code in the mysql_query() > > > call. > > > > > > -Rasmus > > > > > > On Tue, 3 Sep 2002, Matt Zur wrote: > > > > > > > > >>Can someone point me in the direction of an online tutorial for php > > >>mysql that covers the following: > > >> > > >>- Teaches me how to use php to access mysql > > >>- Creating a db that is structured to be efficient > > >>- How to add, modify, and delete records in a database > > >>- How to search for records > > >>- How to filter records > > >>- How to sort records, by a certain field, alphabetical, descending etc. > > >>- Indexes - how to create them, how to keep the updated with changes in > > >>the db a beginners look to in-depth approach. > > >> > > >>Yes I've visited PHP.net, and mysql.com. I need a dumbed down version > > >>that pretty much holds my hand and is very detailed. I've searched the > > >>net for a while now, and all the tutorials I have found... although > > >>simple... they don't go in-depth and move on to more advanced features. > > >> > > >>Any help at all will be greatly appreciated. > > >> > > >>-Matt > > >> > > >> > > >>-- > > >>Matt Zur > > >>[EMAIL PROTECTED] > > >>http://www.zurnet.com > > >> > > >>Need a Web Site??? - Visit... www.zurnet.com > > >> > > >>1997 - 2002 - 5th Anniversary!!! > > >> > > >> > > >>-- > > >>PHP Database Mailing List (http://www.php.net/) > > >>To unsubscribe, visit: http://www.php.net/unsub.php > > >> > > > > > > > > > > > > -- > > Matt Zur > > [EMAIL PROTECTED] > > http://www.zurnet.com > > > > Need a Web Site??? - Visit... www.zurnet.com > > > > 1997 - 2002 - 5th Anniversary!!! > > > > > > -- > > PHP Database Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > >-- >PHP Database Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] One last step
Try SELECT name, COUNT(*) AS nb FROM mytable GROUP BY name ORDER BY nb DESC Ignatius "RClark" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hello all, > > I have a MySQL database with some 2 million rows in it. I am counting all > of the different names in one column. How to I get these to come out in > descending order, with the most numbers of one event at the top and going > down from there? > > Thanks in advance, > Ron Clark > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > - Original Message - From: "RClark" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, September 03, 2002 4:27 PM Subject: [PHP-DB] One last step > Hello all, > > I have a MySQL database with some 2 million rows in it. I am counting all > of the different names in one column. How to I get these to come out in > descending order, with the most numbers of one event at the top and going > down from there? > > Thanks in advance, > Ron Clark > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Indepth Tutorial... need help.
For a SQL tutorial, I would recommend that you get yourself a copy of Joe Celko's "SQL for smarties". Best investment I ever made. Everything you need to know is there. Bon courage! - Original Message - From: "Matt Zur" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, September 03, 2002 3:08 PM Subject: Re: [PHP-DB] Indepth Tutorial... need help. > Right well that's what I'm asking I need a tutorial and haven't found a > good one. > > -Matt > > Rasmus Lerdorf wrote: > > Most of this stuff is actually just SQL and has little to do with PHP. So > > look for an SQL tutorial. From the PHP side all you need to know is > > mysql_connect(), mysql_select_db(), mysql_query() and mysql_fetch_row().'' > > > > All queries are sent to the database via mysql_query(). It doesn't matter > > to PHP if you are adding, deleting, modifying, searching, sorting, > > filtering, or whatever. You just put the SQL code in the mysql_query() > > call. > > > > -Rasmus > > > > On Tue, 3 Sep 2002, Matt Zur wrote: > > > > > >>Can someone point me in the direction of an online tutorial for php > >>mysql that covers the following: > >> > >>- Teaches me how to use php to access mysql > >>- Creating a db that is structured to be efficient > >>- How to add, modify, and delete records in a database > >>- How to search for records > >>- How to filter records > >>- How to sort records, by a certain field, alphabetical, descending etc. > >>- Indexes - how to create them, how to keep the updated with changes in > >>the db a beginners look to in-depth approach. > >> > >>Yes I've visited PHP.net, and mysql.com. I need a dumbed down version > >>that pretty much holds my hand and is very detailed. I've searched the > >>net for a while now, and all the tutorials I have found... although > >>simple... they don't go in-depth and move on to more advanced features. > >> > >>Any help at all will be greatly appreciated. > >> > >>-Matt > >> > >> > >>-- > >>Matt Zur > >>[EMAIL PROTECTED] > >>http://www.zurnet.com > >> > >>Need a Web Site??? - Visit... www.zurnet.com > >> > >>1997 - 2002 - 5th Anniversary!!! > >> > >> > >>-- > >>PHP Database Mailing List (http://www.php.net/) > >>To unsubscribe, visit: http://www.php.net/unsub.php > >> > > > > > > > -- > Matt Zur > [EMAIL PROTECTED] > http://www.zurnet.com > > Need a Web Site??? - Visit... www.zurnet.com > > 1997 - 2002 - 5th Anniversary!!! > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] One last step
Hello all, I have a MySQL database with some 2 million rows in it. I am counting all of the different names in one column. How to I get these to come out in descending order, with the most numbers of one event at the top and going down from there? Thanks in advance, Ron Clark -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Indepth Tutorial... need help.
Just one more to throw on the fire: Pretty basic tutorial that covers a lot of topics. If you buy the book, there's a little more depth. On my first day working with PHP/MySQL, I had basic pages up and running. http://www.webmasterbase.com/article/228 Incidentally, this same question was asked by a different user last week. You might want to poke around the php-db archives for some other recommendations. -Original Message- From: Matt Zur [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 03, 2002 9:09 AM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Indepth Tutorial... need help. Right well that's what I'm asking I need a tutorial and haven't found a good one. -Matt Rasmus Lerdorf wrote: > Most of this stuff is actually just SQL and has little to do with PHP. So > look for an SQL tutorial. From the PHP side all you need to know is > mysql_connect(), mysql_select_db(), mysql_query() and mysql_fetch_row().'' > > All queries are sent to the database via mysql_query(). It doesn't matter > to PHP if you are adding, deleting, modifying, searching, sorting, > filtering, or whatever. You just put the SQL code in the mysql_query() > call. > > -Rasmus > > On Tue, 3 Sep 2002, Matt Zur wrote: > > >>Can someone point me in the direction of an online tutorial for php >>mysql that covers the following: >> >>- Teaches me how to use php to access mysql >>- Creating a db that is structured to be efficient >>- How to add, modify, and delete records in a database >>- How to search for records >>- How to filter records >>- How to sort records, by a certain field, alphabetical, descending etc. >>- Indexes - how to create them, how to keep the updated with changes in >>the db a beginners look to in-depth approach. >> >>Yes I've visited PHP.net, and mysql.com. I need a dumbed down version >>that pretty much holds my hand and is very detailed. I've searched the >>net for a while now, and all the tutorials I have found... although >>simple... they don't go in-depth and move on to more advanced features. >> >>Any help at all will be greatly appreciated. >> >>-Matt >> >> >>-- >>Matt Zur >>[EMAIL PROTECTED] >>http://www.zurnet.com >> >>Need a Web Site??? - Visit... www.zurnet.com >> >>1997 - 2002 - 5th Anniversary!!! >> >> >>-- >>PHP Database Mailing List (http://www.php.net/) >>To unsubscribe, visit: http://www.php.net/unsub.php >> > > -- Matt Zur [EMAIL PROTECTED] http://www.zurnet.com Need a Web Site??? - Visit... www.zurnet.com 1997 - 2002 - 5th Anniversary!!! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Indepth Tutorial... need help.
http://www.mysql.com/doc/en/Tutorial.html is a good place to start with the mysql functions in the php manual. http://www.devshed.com/Server_Side/ has a number of on line tutes amongst others. phpbuilder also is useful. The normalisation article is a good first step; it is at http://www.phpbuilder.com/columns/barry2731.php3 Tim Morris - Original Message - From: Matt Zur <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, September 03, 2002 11:08 PM Subject: Re: [PHP-DB] Indepth Tutorial... need help. : Right well that's what I'm asking I need a tutorial and haven't found a : good one. : : -Matt : : Rasmus Lerdorf wrote: : > Most of this stuff is actually just SQL and has little to do with PHP. So : > look for an SQL tutorial. From the PHP side all you need to know is : > mysql_connect(), mysql_select_db(), mysql_query() and mysql_fetch_row().'' : > : > All queries are sent to the database via mysql_query(). It doesn't matter : > to PHP if you are adding, deleting, modifying, searching, sorting, : > filtering, or whatever. You just put the SQL code in the mysql_query() : > call. : > : > -Rasmus : > : > On Tue, 3 Sep 2002, Matt Zur wrote: : > : > : >>Can someone point me in the direction of an online tutorial for php : >>mysql that covers the following: : >> : >>- Teaches me how to use php to access mysql : >>- Creating a db that is structured to be efficient : >>- How to add, modify, and delete records in a database : >>- How to search for records : >>- How to filter records : >>- How to sort records, by a certain field, alphabetical, descending etc. : >>- Indexes - how to create them, how to keep the updated with changes in : >>the db a beginners look to in-depth approach. : >> : >>Yes I've visited PHP.net, and mysql.com. I need a dumbed down version : >>that pretty much holds my hand and is very detailed. I've searched the : >>net for a while now, and all the tutorials I have found... although : >>simple... they don't go in-depth and move on to more advanced features. : >> : >>Any help at all will be greatly appreciated. : >> : >>-Matt : >> : >> : >>-- : >>Matt Zur : >>[EMAIL PROTECTED] : >>http://www.zurnet.com : >> : >>Need a Web Site??? - Visit... www.zurnet.com : >> : >>1997 - 2002 - 5th Anniversary!!! : >> : >> : >>-- : >>PHP Database Mailing List (http://www.php.net/) : >>To unsubscribe, visit: http://www.php.net/unsub.php : >> : > : > : : : -- : Matt Zur : [EMAIL PROTECTED] : http://www.zurnet.com : : Need a Web Site??? - Visit... www.zurnet.com : : 1997 - 2002 - 5th Anniversary!!! : : : -- : PHP Database Mailing List (http://www.php.net/) : To unsubscribe, visit: http://www.php.net/unsub.php : -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Indepth Tutorial... need help.
On Tue, 03 Sep 2002 08:56:43 -0400 Matt Zur <[EMAIL PROTECTED]> wrote: > Can someone point me in the direction of an online tutorial for php > mysql that covers the following: http://www.phpbuilder.com http://www.devshed.com http://www.devarticles.com Well, if you do not find something here :-) pa -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Indepth Tutorial... need help.
Right well that's what I'm asking I need a tutorial and haven't found a good one. -Matt Rasmus Lerdorf wrote: > Most of this stuff is actually just SQL and has little to do with PHP. So > look for an SQL tutorial. From the PHP side all you need to know is > mysql_connect(), mysql_select_db(), mysql_query() and mysql_fetch_row().'' > > All queries are sent to the database via mysql_query(). It doesn't matter > to PHP if you are adding, deleting, modifying, searching, sorting, > filtering, or whatever. You just put the SQL code in the mysql_query() > call. > > -Rasmus > > On Tue, 3 Sep 2002, Matt Zur wrote: > > >>Can someone point me in the direction of an online tutorial for php >>mysql that covers the following: >> >>- Teaches me how to use php to access mysql >>- Creating a db that is structured to be efficient >>- How to add, modify, and delete records in a database >>- How to search for records >>- How to filter records >>- How to sort records, by a certain field, alphabetical, descending etc. >>- Indexes - how to create them, how to keep the updated with changes in >>the db a beginners look to in-depth approach. >> >>Yes I've visited PHP.net, and mysql.com. I need a dumbed down version >>that pretty much holds my hand and is very detailed. I've searched the >>net for a while now, and all the tutorials I have found... although >>simple... they don't go in-depth and move on to more advanced features. >> >>Any help at all will be greatly appreciated. >> >>-Matt >> >> >>-- >>Matt Zur >>[EMAIL PROTECTED] >>http://www.zurnet.com >> >>Need a Web Site??? - Visit... www.zurnet.com >> >>1997 - 2002 - 5th Anniversary!!! >> >> >>-- >>PHP Database Mailing List (http://www.php.net/) >>To unsubscribe, visit: http://www.php.net/unsub.php >> > > -- Matt Zur [EMAIL PROTECTED] http://www.zurnet.com Need a Web Site??? - Visit... www.zurnet.com 1997 - 2002 - 5th Anniversary!!! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Indepth Tutorial... need help.
Most of this stuff is actually just SQL and has little to do with PHP. So look for an SQL tutorial. From the PHP side all you need to know is mysql_connect(), mysql_select_db(), mysql_query() and mysql_fetch_row().'' All queries are sent to the database via mysql_query(). It doesn't matter to PHP if you are adding, deleting, modifying, searching, sorting, filtering, or whatever. You just put the SQL code in the mysql_query() call. -Rasmus On Tue, 3 Sep 2002, Matt Zur wrote: > Can someone point me in the direction of an online tutorial for php > mysql that covers the following: > > - Teaches me how to use php to access mysql > - Creating a db that is structured to be efficient > - How to add, modify, and delete records in a database > - How to search for records > - How to filter records > - How to sort records, by a certain field, alphabetical, descending etc. > - Indexes - how to create them, how to keep the updated with changes in > the db a beginners look to in-depth approach. > > Yes I've visited PHP.net, and mysql.com. I need a dumbed down version > that pretty much holds my hand and is very detailed. I've searched the > net for a while now, and all the tutorials I have found... although > simple... they don't go in-depth and move on to more advanced features. > > Any help at all will be greatly appreciated. > > -Matt > > > -- > Matt Zur > [EMAIL PROTECTED] > http://www.zurnet.com > > Need a Web Site??? - Visit... www.zurnet.com > > 1997 - 2002 - 5th Anniversary!!! > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Indepth Tutorial... need help.
Can someone point me in the direction of an online tutorial for php mysql that covers the following: - Teaches me how to use php to access mysql - Creating a db that is structured to be efficient - How to add, modify, and delete records in a database - How to search for records - How to filter records - How to sort records, by a certain field, alphabetical, descending etc. - Indexes - how to create them, how to keep the updated with changes in the db a beginners look to in-depth approach. Yes I've visited PHP.net, and mysql.com. I need a dumbed down version that pretty much holds my hand and is very detailed. I've searched the net for a while now, and all the tutorials I have found... although simple... they don't go in-depth and move on to more advanced features. Any help at all will be greatly appreciated. -Matt -- Matt Zur [EMAIL PROTECTED] http://www.zurnet.com Need a Web Site??? - Visit... www.zurnet.com 1997 - 2002 - 5th Anniversary!!! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] [mysql] query wierness :/
this function doesnt work function query($sql) { return mysql_query($sql, $this->mysql_link) or die("query failed: $sql"); } but this one does function query($sql) { $mysql_result = mysql_query($sql, $this->mysql_link) or die("query failed: $sql"); return $mysql_result; } why does it matter?? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] External file integryti check
Hi, id'like to know the opinion about to ensure external file integrity. Scenario: A web application that uses binary files( images, PDF's ). On the database ( postgresql 7.2.2 ) i store the filename of the files. The files ( images only ) are taken from an internal machine when needed( via ftp ) or automatically at idle periods.If the image comes throuth ftp( requested by a user ), the image is downloaded to a temporary directory, a record is inserted into the database and the file get's moved to the final directory if it passed some tests.If no image is requested by a user, a script will download( rcp ) at night the files and then put those in the final directory.When a user request's a PDF, i create the PDF in realtime, using info. stored in the DB plus the image( store on filesystem ). My concern here is the folowing: let's imagine that an image file is overwriten with a new image( by mistake ). This is possible because users use some kind of ID to name the file. If this appens, the info stored in DB is out of sync in relation to the file stored in filesystem. To correct this issues i have three possibilities: 1 - Store the PDF's in the filesystem, and store the file date, time andCRC32 of the entire file in the database. This solution has a consequence... i will need lots of space in the server( each file is aprox. 2MB ). At night a script will validate the sync between the info stored in DB and the info on filesystem. 2 - Create the PDF when requested. When the PDF generated for the first time, i will store: image creation date, time, crc32 and some more dates, times and CRC32's of other information into the DB. At night a script will validate the sync between the info stored in DB and the info on filesystem. 3 - Run a script that is change file permissions( file is created with user owner of webserver) for those new records inserted to root. A script will be run, because i cant change ownership of a file on the fly with PHP( PHP security ). Those are my solution's, if any one has any comments or suggestion's please share it with us.Thank's Miguel Carvalho -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: mssql: insert a record and return the auto increment ID
> > > > To insert the record I use this code: > > $sSql = "INSERT INTO myTable (time_in ) VALUES ( getdate() )"; > > try something like > $sSql = "INSERT INTO myTable (time_in ) VALUES ( getdate() ); SELECT > @@IDENTITY"; > > works with the Perl DBI at least. > > :-)christian > But if I get the ID in a second queries on a very busy web server with less persistant database connection, it is not reliable. If two clients execute this call at the same time with the same connection, I would possiblely get the wrong ID, wouldn't I? Is there a way to do this in one step? By the way, I can't use a string with more than one query in the mssql_query() function. I get error like: Attempt to initiate a new SQL Server operation with results pending on the next query() call. Heiko "Heiko Mundle" <[EMAIL PROTECTED]> schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I insert a new record with PHP into my MS SQL Server database. > The key is defined with > auto_idINT IDENTITY(1000,1) NOT NULL, > > how do I get the new id to use it in PHP? > > To insert the record I use this code: > $sSql = "INSERT INTO myTable (time_in ) VALUES ( getdate() )"; > $pResult = mssql_query($sSql, $g_pDBServer); > > > Thanks a lot for your help > > Heiko > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php