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
Here's the query:
SELECT * FROM book ORDER BY $sort $dir LIMIT $offset, $records_per_page;
$sort == 'title, sub_title'; $dir==ASC (or DESC); $offset== (any
multiple of 10); $records_per_page== 10;
I could let the user change these, but I decided it is simpler to keep
it at 10 books/page. Only the
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.
order by text2 desc;
+--+---+
| text | text2 |
+--+---+
| �   |    1 |
| a   |    0 |
+--+---+
What Collation are you using? can you send us the table schema?
thx!
Isart
On Thu, Jun 11, 2009 at 4:48 PM, PJ af.gour...@videotron.ca
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 always
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
Michael Dykman wrote:
On Fri, May 22, 2009 at 12:26 AM, PJ af.gour...@videotron.ca wrote:
Michael Dykman wrote:
On Thu, May 21, 2009 at 11:06 PM, PJ af.gour...@videotron.ca wrote:
I have a seemingly impossible situation. I cannot insert values into the
tables and I cannot
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
Michael Dykman wrote:
On Thu, May 21, 2009 at 11:06 PM, PJ af.gour...@videotron.ca 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
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 wrote:
Tom Worster wrote:
On 5/5/09 4:42 PM, Richard S. Crawford rscrawf...@mossroot.com wrote:
On Tue, May 5, 2009 at 1:34 PM, PJ af.gour...@videotron.ca wrote:
I'm coming up with a bit of a quandry: how to enter and retrieve an
identical book title with different authors.
It is rather
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
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.),
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
David Giragosian wrote:
On Wed, Apr 1, 2009 at 1:27 PM, PJ af.gour...@videotron.ca
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
query
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 reliable
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
intermittently. My application is for administrators (the site
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
What is this supposed to mean from the manual:
The use of |mysql_num_rows()|
http://dev.mysql.com/doc/refman/5.0/en/mysql-num-rows.html depends on
whether you use |mysql_store_result()|
http://dev.mysql.com/doc/refman/5.0/en/mysql-store-result.html or
|mysql_use_result()|
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
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 administration
What is wrond with this file? same identical insert works from console
but not from this file :-(
html
head
titleUntitled/title
/head
body
?
//include (lib/db1.php);// Connect to database
mysql_connect('biggie', 'user', 'password', 'test');
$sql1 = INSERT INTO example (name, age) VALUES
? :-)
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 have the db connections file commented out.
On Thu, Feb 26, 2009 at 12:28
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 :-(
html
head
titleUntitled/title
/head
body
?
//include (lib/db1.php); // Connect to database
mysql_connect('biggie
,$db);
if (!$result1) {
echo(PError performing 1st query: .
mysql_error() . /P);
exit();
}
?
On Thu, Feb 26, 2009 at 11:46 AM, PJ af.gour...@videotron.ca
mailto:af.gour...@videotron.ca wrote:
It is commented out because I am using mysql_connect
I don't think it would
Ricardo Dias Marques wrote:
Hi PJ,
On Thu, Feb 26, 2009 at 17:28, PJ af.gour...@videotron.ca wrote:
What is wrond with this file? same identical insert works from console
but not from this file :-(
[snip]
?
//include (lib/db1.php);// Connect to database
mysql_connect('biggie
');
$result1 = mysql_query($sql1,$db);
if (!$result1) {
echo(PError performing 1st query: .
mysql_error() . /P);
exit();
}
?
That should fix the problem.
On Thu, Feb 26, 2009 at 12:46 PM, PJ af.gour...@videotron.ca wrote:
It is commented out because I am using mysql_connect
I
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 file? same identical insert works from console
but not from
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';
Everyone here is trying to help you and that's cool, but EVERYONE on
this list may not be so nice
('Arnie Shwartz', '75');
$result1 = mysql_query($sql1,$db);
if (!$result1) {
echo(PError performing 3st query: .
mysql_error() . /P);
}
echo $sql1;
echo br /;
echo $db_select;
exit();
?
This works fine either as is or using the include... :-)
9el wrote:
But the question is PJ, have you got
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($result);
$query =
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 = 'biggie';
$db_user = 'root';
$db_pass = 'gu...@#$';
$db_name = 'biblane';
Everyone here
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:
On Thu, 2009-02-26 at 13:34 -0500, Darryle Steplight wrote:
Hi 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;
the same generated id.
Hope that helps.
From: PJ [mailto:af.gour...@videotron.ca]
Sent: Wed 2/25/2009 2:01 PM
To: MySql; php-gene...@lists.php.net
Subject: non-auto increment question
I want to insert a new table entry 1 number higher than the highest
Reinhardt Christiansen wrote:
From: PJ af.gour...@videotron.ca
To: MySql mysql@lists.mysql.com
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
wondering how to set up a table
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
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:
);
That example does not sanitize the data before inserting.
Brent
On Mon, Feb 23, 2009 at 10:25 AM, PJ af.gour...@videotron.ca 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 figuring out how
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 =
tables!!
After you connect(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
2009/2/22 PJ af.gour
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
2009/2/22 PJ af.gour...@videotron.ca mailto:af.gour
* Consulting * Administration
http://www.olindata.com
On Sun, Feb 22, 2009 at 4:15 PM, PJ af.gour...@videotron.ca wrote:
Gentlemen,
and all those who care,
THE PROBLEM SEEMS TO BE SOLVED (for now, NEXT is HOW TO QUERY(SELECT)
MULTIPLE AUTHORS AND DISPLAY THAT and then HOW TO DEAL
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 =
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.categoryID
author thingie.
Phil Jourdan
AGAIN: 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 af.gour...@videotron.ca
Here's a tough one
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)
variable,
however, most often NULL becomes indistinguishable from an emtpy string.
On Tue, Feb 17, 2009 at 2:47 AM, PJ af.gour...@videotron.ca wrote:
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
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
Michael Dykman wrote:
On Mon, Feb 16, 2009 at 5:20 PM, PJ af.gour...@videotron.ca 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 display
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
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
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 will surely be the same thing.
BTW, I
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
does not support FK. So, if I have to use foreign
ddevaudre...@intellicare.com wrote:
PJ af.gour...@videotron.ca wrote on 02/10/2009 12:44:04 PM:
-- -
-- Table `books`
-- -
CREATE TABLE IF NOT EXISTS `books` (
`id` SMALLINT(4
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,
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 af.gour...@videotron.ca wrote:
being a newbie to mysql, I'm a little confused about how to deal with
the following:
I am creating a database of books
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:
books(id PK, etc...)
authors(id PK, etc
different ISBN numbers but
not to worry, they are diffeerent but they are unique and would not
conflict with the US numbers.
BTW, it might be worth while for PJ to look at how Amazon stores its
data. I don't think you can find an easier to use database for
searching on books. It looks like
with IE. Some of the links and jscripts
don't work on FireFox.
TIA,
PJ
You can of course simplify things by putting the alternate ISBN number
in the description of the book and put a full text index on it. Same
with alternate authors etc.. It would be a catch all for items that
you don't have
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
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
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 to mysql5.0, 5.1, 6.0.8 from the
Ports collection, cvsup'd the Ports, deinstalled php5, php5-mysql,
phpMyAdmin
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
://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 what I can, there seems to be no way
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
66 matches
Mail list logo