Re: ordering search results

2009-07-17 Thread PJ
gt; too. That's part of the reason you may be getting unexpected results > with your ORDER BY statement. Also, can you show us your select > statements? > > On Fri, Jul 17, 2009 at 11:06 AM, PJ wrote: > >> Can't find anything on the web that deals with my problem(s)

ordering search results

2009-07-17 Thread PJ
Can't find anything on the web that deals with my problem(s). I have to display thousands of book listings by title, sub_title with 10 books per page. The php/mysql code works fine - except: ASC or DESC does not change one iota. I have checked by commandline and find that it is not working at all h

Re: ignore accents in order by

2009-06-11 Thread PJ
+---+ > > mysql>select text,text2 from table1 order by text2 desc; > +--+---+ > | text | text2 | > +--+---+ > | �   |    1 | > | a   |    0 | > +--+---+ > > What Collation are you using? can you send us th

ignore accents in order by

2009-06-11 Thread PJ
Is there a way to order lists while ignoring the accents? So far, I have found nothing simple; and I need to keep the accents for output. The language is French (and québécois) :-) TIA -- Hervé Kempf: "Pour sauver la planète, sortez du capitalisme." ---

Re: Can a MyISAM DB hold /everything/?

2009-05-28 Thread PJ
Scott Haneda wrote: > Unless you have very good reason to store binary data like an image in > your database, do not. It may work well for a time, but always be > prepared that your system will grow. If it grows a good deal relative > to your hardware, and users, and connections etc, you will alw

dumb crash

2009-05-26 Thread PJ
Hydro Quebec just f***ed my server just as I was booting up three machines; XP is ok, FreeBSD 7.1 is the one with mysql problem, FreeBSD 4.10 - don't know, but boots ok. Result: can't access database. One table seems to abort mysqld. PhpMyAdmin connects to all databases except one. mysql> CHECK TA

Re: cannot alter table - solved

2009-05-22 Thread PJ
Michael Dykman wrote: > On Fri, May 22, 2009 at 12:26 AM, PJ wrote: > >> Michael Dykman wrote: >> >>> On Thu, May 21, 2009 at 11:06 PM, PJ wrote: >>> >>> >>>> I have a seemingly impossible situation. I cannot insert val

Re: cannot alter table - solved

2009-05-21 Thread PJ
Michael Dykman wrote: > On Thu, May 21, 2009 at 11:06 PM, PJ wrote: > >> I have a seemingly impossible situation. I cannot insert values into the >> tables and I cannot alter or delete the primary key (which should not >> exist) or delete the foreign keys nor remove

cannot alter table - rather urgent

2009-05-21 Thread PJ
I have a seemingly impossible situation. I cannot insert values into the tables and I cannot alter or delete the primary key (which should not exist) or delete the foreign keys nor remove the constraint. G search doesn't help. CREATE TABLE `book_categories` ( `bookID` smallint(6) unsigned NOT NUL

Re: Password Reset Not Working

2009-05-14 Thread PJ
Carlos Proal wrote: > > The machine mysql.unixslut.com is not the same than localhost, right ??, > If you only need root access from localhost you can delete the first > row (delete from user where user='root' and host='mysql.unixslut.com';) > > > Carlos > > > On 5/14/2009 5:55 PM, Carlos Williams

Re: [PHP] How to deal with identical fields in db

2009-05-05 Thread PJ
Tom Worster wrote: > On 5/5/09 4:42 PM, "Richard S. Crawford" wrote: > > >> On Tue, May 5, 2009 at 1:34 PM, PJ wrote: >> >>> I'm coming up with a bit of a quandry: how to enter and retrieve an >>> identical book title with different a

Re: A good US Hosting Site?

2009-04-20 Thread PJ
I've been using www.host45.com for some years. linux and they've always been reliable. :-) -- unheralded genius: "A clean desk is the sign of a dull mind. " - Phil Jourdan --- p...@ptahhotep.com http://www.ptahhotep.com http://www.

how to join tables on multiple conditions for same column

2009-04-05 Thread PJ
I am trying to select names from a list which depends on another table for their ranking. I want to retrieve all names that start with a Capital letter in last_name and ranking of 1 and any other names that have a ranking of 2 but are both related to a third table. tables: book(id,...etc.), author(

Re: how do I select multiple conditions from 1 table column?

2009-04-01 Thread PJ
David Giragosian wrote: > On Wed, Apr 1, 2009 at 1:27 PM, PJ <mailto:af.gour...@videotron.ca>> wrote: > > I am trying to select all books whose authors last names begin > with I, J > or K. I have 3 tables: book, author and book_author. The following >

how do I select multiple conditions from 1 table column?

2009-04-01 Thread PJ
I am trying to select all books whose authors last names begin with I, J or K. I have 3 tables: book, author and book_author. The following query works with one condition but not with three. SELECT * FROM book WHERE id IN (SELECT bookID FROM book_author WHERE authID IN (SELECT autho

Re: avoiding use of Nulls

2009-03-13 Thread PJ
mich...@j3ksolutions.com wrote: >> On Fri, 13 Mar 2009, mich...@j3ksolutions.com wrote: >> >> >>> Explanation(5): The more you understand how the database is to be used, >>> and the more complexity and thought you put into your database design, >>> the >>> less complex it will be to retrieve r

Re: [PHP] RE: non-auto increment question

2009-03-11 Thread PJ
Ashley Sheridan wrote: > On Thu, 2009-02-26 at 11:27 -0500, PJ wrote: >> Jerry Schwartz wrote: >> >>>> Being rather new to all this, I understood from the MySql manual that >>>> the auto_increment is to b e used immediately after an insertion not >

how to sanitize mysql_connect?

2009-03-04 Thread PJ
I hope this is the right list as it concerns mysql and php ??? I just realized that an open connection is necessary to usemysql_real_escape_string...So how do you sanitize an include page used to open a connection This is the page // db1.php // SQL login parameters for local environment $local_dbho

is there another way

2009-02-27 Thread PJ
Is there another way to determine what the query found? The input is a string "whatever". I'm looking for a return of a string or null or nuber of rows or something that will permit to to channel the execution of the file. The snippet below is good for (there is a match) and (there is no match) but

whoa!

2009-02-27 Thread PJ
What is this supposed to mean from the manual: The use of |mysql_num_rows()| depends on whether you use |mysql_store_result()| or |mysql_use_result()|

Re: [PHP] Re: catch the error

2009-02-26 Thread PJ
Ashley Sheridan wrote: > On Thu, 2009-02-26 at 14:15 -0500, PJ wrote: > >> Ashley Sheridan wrote: >> >>> On Thu, 2009-02-26 at 13:56 -0500, PJ wrote: >>> >>> >>>> Ashley Sheridan wrote: >>>> >>&

Re: [PHP] Re: catch the error

2009-02-26 Thread PJ
Ashley Sheridan wrote: > On Thu, 2009-02-26 at 13:56 -0500, PJ wrote: > >> Ashley Sheridan wrote: >> >>> On Thu, 2009-02-26 at 13:34 -0500, Darryle Steplight wrote: >>> >>> >>>> Hi PJ, >>>>$db_host = '

Re: [PHP] RE: non-auto increment question

2009-02-26 Thread PJ
Ashley Sheridan wrote: > On Thu, 2009-02-26 at 13:44 -0500, Jerry Schwartz wrote: > >>> Here's how I mostly do it (albeit simplified): >>> >>> $query = "INSERT INTO `sometable`(`title`,`content`) >>> VALUES('$title','$content')"; >>> $result = mysql_query($query); >>> $autoId = mysql_insert_id($

Re: [PHP] Re: catch the error

2009-02-26 Thread PJ
Here's the working code... Error performing 3st query: " . mysql_error() . ""); } echo $sql1; echo ""; echo $db_select; exit(); ?> This works fine either as is or using the include... :-) 9el wrote: > But the question is PJ, have you got it out o

Re: [PHP] Re: catch the error

2009-02-26 Thread PJ
Ashley Sheridan wrote: > On Thu, 2009-02-26 at 13:34 -0500, Darryle Steplight wrote: > >> Hi PJ, >>$db_host = 'biggie'; >> $db_user = 'root'; >> $db_pass = 'gu...@#$'; >> $db_name = 'biblane'; >> >> >

Re: catch the error

2009-02-26 Thread PJ
Jerry Schwartz wrote: > >> -Original Message- >> From: PJ [mailto:af.gour...@videotron.ca] >> Sent: Thursday, February 26, 2009 12:28 PM >> To: php-gene...@lists.php.net; MySql >> Subject: catch the error >> >> What is wrond with this f

Re: catch the error

2009-02-26 Thread PJ
ected: (but it still does not work) Error performing 1st query: " . mysql_error() . ""); exit(); } ?> > > That should fix the problem. > > On Thu, Feb 26, 2009 at 12:46 PM, PJ wrote: > >> It is commented out because I am using "mysql_connect&

Re: catch the error

2009-02-26 Thread PJ
Ricardo Dias Marques wrote: > Hi PJ, > > On Thu, Feb 26, 2009 at 17:28, PJ wrote: > > >> What is wrond with this file? same identical insert works from console >> but not from this file :-( >> >> [snip] >> >> > //include ("lib/db

Re: catch the error

2009-02-26 Thread PJ
t; . mysql_error() . ""); exit(); } ?> > > On Thu, Feb 26, 2009 at 11:46 AM, PJ <mailto:af.gour...@videotron.ca>> wrote: > > It is commented out because I am using "mysql_connect" > I don't think it would be good to use both,

Re: [PHP] catch the error

2009-02-26 Thread PJ
Ashley Sheridan wrote: > On Thu, 2009-02-26 at 12:28 -0500, PJ wrote: >> What is wrond with this file? same identical insert works from console >> but not from this file :-( >> >> >> >> Untitled >> >> >> >> > //include ("

Re: catch the error

2009-02-26 Thread PJ
t is wrond with this file?" :-) > Hi PJ, > Could it be that you have "//include ("lib/db1.php"); " commented > out? Try uncommenting that line and see what happens. The error > message will always print because the query is never executing > properly if you ha

catch the error

2009-02-26 Thread PJ
What is wrond with this file? same identical insert works from console but not from this file :-( Untitled Error performing 1st query: " . mysql_error() . ""); exit(); } ?> Seems to be good to print out the error message, but that's all. db not written. -- Phil Jourdan ---

Re: [PHP] RE: non-auto increment question

2009-02-26 Thread PJ
Jerry Schwartz wrote: >> Being rather new to all this, I understood from the MySql manual that >> the auto_increment is to b e used immediately after an insertion not >> intermittently. My application is for administrators (the site owner & >> designates) to update the database from and administra

Re: [PHP] RE: non-auto increment question

2009-02-25 Thread PJ
to use autoincrement, you can run into a race >> condition where two people are inserting at the same time, thus >> having the same generated id. >> >> Hope that helps. >> >> >> >> >> From: PJ [mailto:af.gour

non-auto increment question

2009-02-25 Thread PJ
I want to insert a new table entry 1 number higher than the highest in the field (id). I cannot use auto-increment. And I want to show the value of the field to be added in an input field on the web page: if (isset($_REQUEST["AddNewBooksRequest"])) { $SQL = "SELECT MAX(id) FROM book"; $

insert question

2009-02-24 Thread PJ
Is there a way to insert several rows into a table with one statement? I have this: $sql2 = "INSERT INTO authors (first_name, last_name, ordinal) VALUES ('$first_nameIN', '$last_nameIN', '1')"; $result2 = mysql_query($sql2, $db); I want to avoid doing another insert lik

Re: how to deal with multiple authors for one book

2009-02-24 Thread PJ
Reinhardt Christiansen wrote: > > > >> From: PJ >> To: MySql >> Subject: how to deal with multiple authors for one book >> Date: Mon, 16 Feb 2009 17:20:54 -0500 >> >> In my db there are a number of books with several authors; so, I am >> wonderi

Re: multiple choice dropdown box puzzle

2009-02-23 Thread PJ
Brent Baisley wrote: > It's actually a very simple solution, and you should do it all in a > single INSERT. Putting INSERTs in a loop will kill your performance > when you try to scale. > > $sql4 = 'INSERT INTO test (example) VALUES (' . implode('),(', > $_POST["categoriesIN"]) . ')'; > $result4 =

Re: multiple choice dropdown box puzzle

2009-02-23 Thread PJ
not sanitize the data before inserting. > > Brent > > On Mon, Feb 23, 2009 at 10:25 AM, PJ wrote: > >> I think this is a tough one... and way above my head: >> PLEASE READ ALL OF THE ABOVE TO UNDERSTAND WHAT I AM TRYING TO DO. >> Having a bit of a rough time

multiple choice dropdown box puzzle

2009-02-23 Thread PJ
I think this is a tough one... and way above my head: PLEASE READ ALL OF THE ABOVE TO UNDERSTAND WHAT I AM TRYING TO DO. Having a bit of a rough time figuring out how to formulate php-mysql to insert data into fields using a multiple dropdown box in a form. to post I am using the following: snip.

Re: book categories

2009-02-22 Thread PJ
CONCAT is just a string function, it is not a sql operator, and it is > not giving anything that you don't already know, > dont focus on CONCAT, forget it for now. > > Let me know > > Claudio Nanni > > > 2009/2/22 PJ > > >> Here's a tough on

book categories

2009-02-22 Thread PJ
Here's a tough one... In my library I have some 62 categories where a number of books can be in several categories. Now, to relate the "categories" table(AS c) to the "book" table (AS a), I assume that I need an intermediate table "book_category" (AS d) linking d.bookID to the b.bookID and d.catego

HOW TO QUERY(SELECT) and display MULTIPLE AUTHORS

2009-02-22 Thread PJ
"SELECT b.title, b.sub_title, b.descr, b.comment, b.bk_cover, b.copyright, b.ISBN, c.publisher, CONCAT_WS(' ', first_name, last_name) AS Author FROM book AS b LEFT JOIN book_author AS ab ON b.id = ab.bookID LEFT JOIN author AS a ON ab.authID=a.id LEFT JOIN book_publisher AS abc ON b.id = abc.book

Re: left joins & concat

2009-02-22 Thread PJ
that they are not clear on a lot of details... I may be picky about the small details but it is they that make the whole possible. > Have fun! > > Walter > > OlinData: Professional services for MySQL > Support * Consulting * Administration > http://www.olindata.com > > > &g

Re: left joins & concat

2009-02-22 Thread PJ
nect(join) the two tables you could want to see only > certain rows, ok now you use the WHERE. > > Forget about CONCAT/CONCAT_WS this is a string function, and is not > related to JOINS. > > > Please, let me know if this was useful to you. > > > Claudio Nanni > > > >

Re: left joins & concat

2009-02-22 Thread PJ
nnect(join) the two tables you could want to see only > certain rows, ok now you use the WHERE. > > Forget about CONCAT/CONCAT_WS this is a string function, and is not > related to JOINS. > > > Please, let me know if this was useful to you. > > > Claudio Nanni > > &

left joins & concat

2009-02-21 Thread PJ
I have been searching and searching for a clear and logical explanation of JOINs and have found nothing that can be reasonably understood. Perhaps I am dense or from another planet, but nothing seems to fall into place. I need to display all the books (with their respective authors and publishers)

Re: how to check for null in string

2009-02-17 Thread PJ
lar. Once you've exported a field into a regular variable, > however, most often NULL becomes indistinguishable from an emtpy string. > > > On Tue, Feb 17, 2009 at 2:47 AM, PJ wrote: > >> I know this is not working, but how can I check for NULL; or how can I >> co

how to check for null in string

2009-02-16 Thread PJ
I know this is not working, but how can I check for NULL; or how can I configure my field "sub_title" so I can check if $booksub_title contains anything or is empty. This problem as been breaking my back...don't know what to put in as a default to be able to check against string input (VARCHAR) or

Re: how to deal with multiple authors for one book

2009-02-16 Thread PJ
Michael Dykman wrote: > On Mon, Feb 16, 2009 at 5:20 PM, PJ wrote: > >> In my db there are a number of books with several authors; so, I am >> wondering how to set up a table on books and authors to be able to >> insert (via php-mysql pages) data and retrieve and dis

how to deal with multiple authors for one book

2009-02-16 Thread PJ
In my db there are a number of books with several authors; so, I am wondering how to set up a table on books and authors to be able to insert (via php-mysql pages) data and retrieve and display these books with several authors I suspect that to insert data for a multiple author book I will have to

query and insert data on multiple tables

2009-02-13 Thread PJ
I am trying to create a php-mysql page to POST new records to several tables from one php page and I have to retrieve records from several (like 4 to 8) tables in one query. Being quite new to php & mysql, I am wondering what is the best way to go about this. My tables consist of * Structure

Re: db setup - correction

2009-02-10 Thread PJ
ddevaudre...@intellicare.com wrote: > PJ wrote on 02/10/2009 12:44:04 PM: > > >> -- - >> -- Table `books` >> -- - >> CREATE TABLE IF NOT EXISTS `books` ( &

Re: db setup - correction

2009-02-10 Thread PJ
Peter Brawley wrote: > PJ > > >But what about foreign keys? Don't I need that to find the relationships > >between the books, the authors and the categories? After all, isn't this > >a relational db? If so, I can't use the default engine (MyISAM) which >

Re: db setup - correction

2009-02-10 Thread PJ
Peter Brawley wrote: > PJ, > As I understand it, I have one table "books" it lists all the info for > the book other than the author(s) or the categories ; for these I need > an authors table and a category table... I'll continue with the authors > as categories

Re: db setup - correction

2009-02-09 Thread PJ
Peter Brawley wrote: > PJ > >> Why do I need a third table? > > The clue is "author (could be 2 or more)" in your books column list. > It is incorrect to store two author names or IDs in one column. The > relationship is 1:many. So you need a bridge table: > &

Re: db setup - correction

2009-02-09 Thread PJ
So you have table books, authors and rel_books_authors where rel_books > authors has 3 entries for a book with 3 authors just using the book id and > the author is's > > Olaf > > > On 2/9/09 10:25 AM, "PJ" wrote: > > >> being a newbie to mysql, I'm a litt

db setup

2009-02-09 Thread PJ
being a newbie to mysql, I'm a little confused about how to deal with the following: I am creating a database of books and have come down to this - table for books (books) including fields for id (primary key, auto-incr.) title author (could be 2 or more) category (could be several - eg. youth, fic

Re: how to design book db

2009-01-06 Thread PJ
>> For better or worse, most of "my" publishers don't use ISBNs; many of >> them >> don't even assign product numbers. >> >> I guess the only way around it is to assign your own unique key. > Not only do I have 2 ISBNs for a few books, but ther

Re: how to design book db

2009-01-05 Thread PJ
ith to K.I.S.S this undertaking and would appreciate any >> help or suggestions. >> If it helps, you can see the site as it is at present >> http://www.ptahhotep.com - but since it is rather messed up at the >> moment, it is best viewed with IE. Some of the links and

how to design book db

2008-12-29 Thread PJ
pts don't work on FireFox. TIA, PJ -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org

installation nightmare

2008-12-22 Thread PJ
I feel like one big fat stupid sheep problem SOLVED... It turns out that the root of all the problems was my own little forgetful brain... I had forgotten that I had changed the permissions on the apache22/data files to 766 which prevented the execution of all the php scripts which snowballed

Re: installation nightmare

2008-12-20 Thread PJ
p://www.mysql.com/certification/candidates.php?exam=6> (CMA) Comptia A+ Certified Professional IT Technician On Fri, 2008-12-19 at 15:47 -0500, PJ wrote: Do what I can, there seems to be no way to install mysql 5.1.30 on FreeBSD 7.0 I even removed all files in reference t

Re: installation nightmare

2008-12-19 Thread PJ
fied Developer <http://www.mysql.com/certification/candidates.php?exam=3> (CMDEV) MySQL Certified Associate <http://www.mysql.com/certification/candidates.php?exam=6> (CMA) Comptia A+ Certified Professional IT Technician On Fri, 2008-12-19 at 15:47 -0500, PJ wrote: Do

installation nightmare

2008-12-19 Thread PJ
Do what I can, there seems to be no way to install mysql 5.1.30 on FreeBSD 7.0 I even removed all files in reference to mysql5.0, 5.1, 6.0.8 from the Ports collection, cvsup'd the Ports, deinstalled php5, php5-mysql, phpMyAdmin, Webmin and followed the documentation as closely as possible (a nu

installation nightmare

2008-12-18 Thread PJ
Or should I say 4-day-mare... I have been trying to set up mysql for the last 4 days with weird success. I first installed mysql 6.0.8alpha not knowing I needed 5.0 compatibility for my ISP Website host. I go everything working pretty well... mysql6, php5, phpMyAdmin, all on FreeBSD 7.0 with ap