[PHP-DB] Re: Making a txt file from db data, is it possible?
May I use this dump method with a query too? Or is this only for making a hole table into a txt file? Because I'm trying to get a website into a txt file and save it into a directory on the server to get a order sendt by fax. Or is this a "long way" to go? Regards Raymond "Andy" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > mysqldump dbname.tablename > filename.txt > > Cheers, Andy > > > "Raymond Lilleodegard" <[EMAIL PROTECTED]> schrieb im Newsbeitrag > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > Hi! > > > > I would like to make a txt file our from some db output, is this possible? > > Couldn't find anything about it in the function list. > > > > Thanks for all help! > > > > Best regards > > > > Raymond Lilleodegard > > > > > > > > > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Making a txt file from db data, is it possible?
Hi! I would like to make a txt file our from some db output, is this possible? Couldn't find anything about it in the function list. Thanks for all help! Best regards Raymond Lilleodegard -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: mysql_connect() and phpmyadmin
Hi Martin! I dont think I understood your question right here. Are you trying to connect to mysql ? regards Raymond "Martin Allan Jensen" <[EMAIL PROTECTED]> wrote in message 005901c1b40d$6143c390$040a@IceSystems">news:005901c1b40d$6143c390$040a@IceSystems... I just don't understand why phpmyadmin works with it when i can't call it.! I did try with "localhost" but it won't still work.. PLEASE help i just can't understand it Kind regards Martin -Original Message- From: Martin Allan Jensen [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 12, 2002 10:44 AM To: Rick Emery Subject: Re: [PHP-DB] mysql_connect() It wasen't me hwo did it! but why do phpmyadmin work fine then?? Martin - Original Message - From: "Rick Emery" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, February 12, 2002 5:29 PM Subject: RE: [PHP-DB] mysql_connect() > Re-read my previous email. You do not have mysql functionality compiled > into PHP and you web server. The clue is the phrase "undefined function: > mysql_connect()". > How did you load PHP, MYSQL, etc? > > -Original Message- > From: Martin Allan Jensen [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, February 12, 2002 10:26 AM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] mysql_connect() > > > Sorry folks, last time i wrote it to fast! Well here is the hole > story > > We got an organisation to install a new version of phpmyadmin, mySQL and PHP > 4.0.6 on our Cobalt Raq 4r server (Linux) > > They got it installed and phpmyadmin is working finebut when i call fro > a script souch as > % > // Connecting, selecting database > $link = mysql_connect("127.0.0.10", "phpcoder_dk", "pdw") > or die("Could not connect"); > print "Connected successfully"; > mysql_select_db("phpcoder_dk") > or die("Could not select database"); > > // Performing SQL query > $query = "SELECT * FROM hits"; > $result = mysql_query($query) > or die("Query failed"); > ?> > % > > The script writes this. > % > Fatal error: Call to undefined function: mysql_connect() in > /home/sites/site2/web/sql.php on line 3 > % > > You can test it at http://www.phpcoder.dk/sql.php > > I really hope that someone will help me cause i really can't find the > problem by myself...! > > Kind regards > Martin Allan Jensen > > -- > 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: count from the results
Hi Barry! you can do it like this for example: $query = "SELECT * FROM artist WHERE artist_name LIKE 'b%' ORDER BY artist ASC"; $count = mysql_query("SELECT COUNT(artist) AS count FROM artist WHERE artist_name LIKE 'b%'",$db); $x = mysql_fetch_array($count); $result = mysql_query($query) or die("Select Failed!"); $number = $x["count"]; echo "Total Number Of Artists In \"B\": "; echo "$number"; echo ""; if (mysql_num_rows($result)) { echo ""; echo "Artists"; while ($qry = mysql_fetch_array($result)){ echo ""; echo ""; echo $qry[artist]; > }}?> "Barry Rumsey" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]... > I have the following code: > $query = "SELECT * FROM artist WHERE artist LIKE 'b%' ORDER BY artist > ASC"; > $result = mysql_query($query) or die("Select Failed!"); > echo "Total Number Of Artists In \"B\": "; > echo mysql_num_rows($result); > echo ""; > if (mysql_num_rows($result)) { > echo ""; > echo "Artists"; > while ($qry = mysql_fetch_array($result)){ > echo ""; > echo ""; > echo $qry[artist]; > }}?> > > What I would like to know is how do I do a count on each result > returned.e.g. Benny(4) , Bill(10) > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Query with numbers like 1, 3, 5..........
Thank's a lot guys for helping me out here! Now I can sleep well to night ; ) "Mike Gohlke" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > > $qry = mysql_query("select * from tablename order by id"); > while ( $ref1 = mysql_fetch_object($qry) ) { > $ref2 = mysql_fetch_object($qry) > ?>$ref1->id $ref2->id } > ?> > > > btw, the is to keep the internal cell borders from not appearing > using netscape. (keeps it from being empty). > > Hope this helps > Mike... > > Raymond Lilleodegard wrote: > > >Hi again Rick! : ) > > > >It is because I am trying to list all products that I have in a database > >into a "menu page". And I would like to have two products beside eachothers. > >So... is it possible to get two datarows in one: > > > >do { > > > >} while (mysql_fetch_array() ); > > > >?? or is this a stupid way to do it? > > > >Reagrds Raymond > >- Original Message - > >From: "Rick Emery" <[EMAIL PROTECTED]> > >To: "'Raymond Lilleodegard'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > >Sent: Thursday, February 07, 2002 8:55 PM > >Subject: RE: [PHP-DB] Query with numbers like 1, 3, 5.. > > > > > >>Yes, but the question is why? > >> > >>-Original Message- > >>From: Raymond Lilleodegard [mailto:[EMAIL PROTECTED]] > >>Sent: Thursday, February 07, 2002 1:22 PM > >>To: [EMAIL PROTECTED] > >>Subject: [PHP-DB] Query with numbers like 1, 3, 5.. > >> > >> > >>Hi! > >> > >>Is there a way to get the rows with id's like 1, 3, 5, and so on or 2, 4, > >> > >6, > > > >>...? > >> > >> > >>Best regards Raymond > >> > >> > >> > >>-- > >>PHP Database Mailing List (http://www.php.net/) > >>To unsubscribe, visit: http://www.php.net/unsub.php > >> > >> > >"Rick Emery" <[EMAIL PROTECTED]> wrote in message > >[EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > > >>Yes, but the question is why? > >> > >>-Original Message- > >>From: Raymond Lilleodegard [mailto:[EMAIL PROTECTED]] > >>Sent: Thursday, February 07, 2002 1:22 PM > >>To: [EMAIL PROTECTED] > >>Subject: [PHP-DB] Query with numbers like 1, 3, 5.. > >> > >> > >>Hi! > >> > >>Is there a way to get the rows with id's like 1, 3, 5, and so on or 2, 4, > >> > >6, > > > >>...? > >> > >> > >>Best regards Raymond > >> > >> > >> > >>-- > >>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] Query with numbers like 1, 3, 5..........
Hi again Rick! : ) It is because I am trying to list all products that I have in a database into a "menu page". And I would like to have two products beside eachothers. So... is it possible to get two datarows in one: do { } while (mysql_fetch_array() ); ?? or is this a stupid way to do it? Reagrds Raymond - Original Message - From: "Rick Emery" <[EMAIL PROTECTED]> To: "'Raymond Lilleodegard'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Thursday, February 07, 2002 8:55 PM Subject: RE: [PHP-DB] Query with numbers like 1, 3, 5.. > Yes, but the question is why? > > -Original Message- > From: Raymond Lilleodegard [mailto:[EMAIL PROTECTED]] > Sent: Thursday, February 07, 2002 1:22 PM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] Query with numbers like 1, 3, 5.. > > > Hi! > > Is there a way to get the rows with id's like 1, 3, 5, and so on or 2, 4, 6, > ...? > > > Best regards Raymond > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > "Rick Emery" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Yes, but the question is why? > > -Original Message- > From: Raymond Lilleodegard [mailto:[EMAIL PROTECTED]] > Sent: Thursday, February 07, 2002 1:22 PM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] Query with numbers like 1, 3, 5.. > > > Hi! > > Is there a way to get the rows with id's like 1, 3, 5, and so on or 2, 4, 6, > ...? > > > Best regards Raymond > > > > -- > 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] Query with numbers like 1, 3, 5..........
Hi! Is there a way to get the rows with id's like 1, 3, 5, and so on or 2, 4, 6, ...? Best regards Raymond -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Is this possible?
Hi! I have this tricky case, at lest for me : ) I'm trying to get some data out of two tables and listing the data in a product/price site. But. : I have one table with productinfo and one with prices. And it is several columns with the same id in the pricetable, because every product have several sizes. So... how do I get only one row from the "product table" and two rows from the "price table" in one line in a page? Is it possible? Best regards Raymond -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Another dynamic sql.
Hi all! I have this form with some choices: Enter how many cars you want: ford bmw mercedes And then I am trying to get the price out of a table in my database with this code: $sql = mysql_query("SELECT '$car' FROM varetabell where carid='$carid' "); $myrow= mysql_fetch_array($sql); $x = $myrow["$car"]; $price = $x * $number; Shouldn't this work? Or am I missing something here? Best regards Raymond -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]