Or is there a better way to check multiple options against an enum inside
your select statement?
IN
for example: orderstatus IN ( 'Cancelled', 'New', 'Denied', 'Expired')
However this is not exactly what you are doing. You want different orderdate
$yesterday depending on the orderstatus.
mysqldump is a separate program (it runs outside of the mysql shell). I
noticed you have ; at the end and perhaps you are trying to run it inside
MySQL client.
The ; by itself is not a problem for the OS shell (bash or whatever) but you
don't need it unless you are running multiple commands
You already have a foreign key, that is stores.store_by references
users.user_id. You might not have declared it (which is OK) but if that is the
key you want that is fine.
I suspect you are seeing an inadvertent Cartesian product. The way you have
written this query you will get one row
On Jan 6, 2009, at 7:41 AM, php-db-digest-h...@lists.php.net wrote:
I was wondering if there is a php function
and/or mysql function that can be run from php to find out the
privileges
for a particular db connection. Any ideas?
Just to get you started try:
select * from mysql.user
If you only have Wednesdays in you table - that is select the next 12
records after today it's easy:
SELECT * FROM christian_discipleship WHERE created_for_date now()
ORDER BY created_for_date ASC LIMIT 12
Good luck,
Frank
On Oct 6, 2006, at 8:29 PM, [EMAIL PROTECTED] wrote:
I am
This is an HTML issue (not PHP or MySQL) that is HTML ignores
carriage returns (and most other white spaces).
There are two simple solutions:
use pre tags:
echo pre $rmks/pre;
Or replace the \n with br
$newRmks = str_replace ( \n, br, $rmks );
echo $newRmks;
You can do this going
Ron
You want SELECT DISTINCT ... or SELECT column list FROM table
GROUP BY column list
In either case you probably can't use SELECT * - you have to specify
the columns you're after. This is because these commands will look
for any differences and if they see one they'll give you a new
On Nov 10, 2005, at 7:21 AM, [EMAIL PROTECTED] wrote:
Need some ideas/opinions on a project I have.
The project is for a Radio Station (online one) where DJ's can
login to the site and do stuff and listeners can listen in live to
the live feeds.
Now I downloaded a password protected
What is causing this is a single quote in the string you're trying to
insert.
You should use:
$yourString = mysql_real_escape_string ( $yourString );
before you try to insert it.
Also it looks like you have named your table 'view' and I suggest you
don't do this, in the new version of
I'm thinking that you need a LEFT JOIN (see the mysql
documentation) to do this. Basically LEFT JOIN (or RIGHT JOIN) allow
you to select all the rows from the table on the left side even if
they have no corresponding row on the right side (the values of the
columns in the select that
A few ideas occur to me. You don't have enough information about
your schema for me to say for sure which of these would be best.
1 - put all the inserts into one statement:
$myQuery = INSERT INTO purchaseItems (orderID, itemIDs,
itemQty) VALUES (;
$i = 1;
foreach ($order as
First off - is this a solution in search of a problem? Databases
are excellent at indexing and caching frequently used data. Though
your table has millions of rows and you are only really interested in
a few hundred you might find that performance is not noticeably any
different than if
There must be a dozen solutions here; mysqldump and cron come to mind
but you haven't been very specific with your needs.
Is your database server Windows or Unix? Can you write a simple
script (or modify an example) to fit your needs? What are you going to
back up to? Another server? Tape?
Using hidden fields is not less secure than using visible fields - or
session variables which were filled out by end user input.
Hidden fields can be modified but so can any other field and you need
to check that the values you receive are expected and proper before you
process them. There
The method doesn't matter, use whatever you like.
Did this quick just for the fun, it seems to work. Set $search to
whatever you'd like to try or to your GET or POST argument.
,,, eurpoe won't cause a problem but + + + europe will generate
some odd SQL (although it will work as expected -
a SELECT statement and the results
are put into this cursor and now you can run a loop of some kind on that
cursor.
Personally I can't remember the last time I used one, but I know I have used
one - I remember looking it up.
Frank
--
Frank Flynn
Poet, Artist Mystic
--
PHP Database Mailing List
,email VARCHAR(30),answer TEXT, PRIMARY KEY(ID));
Is there any other date field that gets the date form as I want?
Thanks in advance
Charalambos Nicolaou
--
Frank Flynn
Poet, Artist Mystic
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net
the number of queries down, as it has to do join searches on a couple
of these to handle the perms and other things on each page...
TIA
Rene
--
Rene Brehmer
aka Metalbunny
http://metalbunny.net/
References, tools, and other useful stuff...
--
Frank Flynn
Poet, Artist Mystic
--
PHP
... anyone have an idea??
THanks in advance...
Aleks
--
Frank Flynn
Poet, Artist Mystic
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
] how to do query on partial field contents ???
--
Frank Flynn
Poet, Artist Mystic
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
another query
Any idea
--
Frank Flynn
Poet, Artist Mystic
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Too true - this is why a page that I promised would only take a few minutes
winds up taking all week.
But it makes steady employment for the QA team...
Frank
On 2/24/04 10:37 AM, Andy Armstrong [EMAIL PROTECTED] wrote:
Frank Flynn wrote:
And if you'd like to make wild carding optional
button only needs to store the web_user value and the number
of the row you're on now. If you need some sample code I can send you some
but really it's pretty straight forward in the PHP side.
Good Luck,
Frank
--
Frank Flynn
Poet, Artist Mystic
--
PHP Database Mailing List (http
must be missing something simple.
(using mysql)
thx for any clues
Gil
--
Frank Flynn
Poet, Artist Mystic
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Subscribe digest
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
The problem is you're overloading your PATH field. An SQL engine cannot
tell the different meanings between (other than they are different):
' 1 3 7' and
' 1 2 6'
You can do this 'live' with only the ID, PID and the name SECTION and then a
temporary
is up to 10 seconds! Was the
array method the better way?
--
Frank Flynn
Poet, Artist Mystic
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Craig,
You can use just about any modern DBMS. If you're concerned about support
why not ask your hosting company up front - I've never had any problems
finding support for MySQL (although my Oracle, MS and IBM sales reps have
all claimed I would).
The cost is stunning - Oracle list price is
Yes there is, it's kind of a hack...
If you insert using values you can only insert 1 row:
INSERT foo (col1, col2, col3)
VALUES(Moe, Larry, Curley)
But if you use a select statement it will insert as many rows as the select
returns:
INSERT foo (col1, col2, col3)
SELECT col1, col2, col3
) of a
cartain column whithin a row and show up the result? I have several time
inputs and need to show the total.
Thanx.
Cesar Aracena
[EMAIL PROTECTED]
Neuquen, Argentina
--
Frank Flynn
Poet, Artist Mystic
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http
Hi Dave,
The easiest, most direct, ANSI - SQL way to do what you ask is:
SELECT count(*) as num_posts, Admin_id
FROM your_table_Name
WHERE optional but you could narrow the results here
GROUP BY Admin_id
ORDER BY Admin_id
This will give you:
num_posts Admin_id
-
3
On 4/27/02 1:52 AM, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
I'm not too familiar with idc/htx but I have used PHP, IIS, MS SQL and Linux
and had great results.
Here are some ideas that might help you:
-Try installing PHP on your current server (IIS) now you can convert
sections of your web
and .htpasswd
files but I'm not sure yet...
Can anyone suggest the best way to protect my database? If it is to
complicated to be explained in an email please suggest just the functions
names and I'll try to find the way...
Thanx
Achilles
--
Frank Flynn
Poet, Artist Mystic
--
PHP Database
development one, out of date maybe but you should see my clothes but PHP
was test downloaded a month ago - any ideas from a white knight?
best regards
Rob
--
Frank Flynn
Poet, Artist Mystic
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net
.
if ($quantity == 0)
{
$gone = mysql_query(DELETE FROM {$config[prefix]}_my_items WHERE
uid={$session[uid]} AND id = '$item');
}
--
Frank Flynn
Poet, Artist
but for MySQL it's:
SHOW TABLE STATUS FROM ... LIKE ...
In MS SQL it's:
sp_spaceused ...
In Informix it's:
onstat (-something I forget which but there help in onstat)
I forget Oracle but it's somewhere in the Enterprise manager...
Good Luck,
Frank
--
Frank Flynn
Poet, Artist Mystic
On 4/6/02 4:12 PM, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
From: Raymond Lilleodegard [EMAIL PROTECTED]
Date: Sat, 6 Apr 2002 17:18:07 +0200
To: [EMAIL PROTECTED]
Subject: 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
Hi All,
I'm just starting on a database to track IP addresses. I'm thinking about
how best to store the IP address - 4 tinyints, varchar or char; as one big
varchar or 4 chunks?
We will eventually want to look at things by net or subnet and being able to
search on the various parts of the
See below...
On 3/23/02 2:20 PM, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
From: Ljungan [EMAIL PROTECTED]
Date: Sat, 23 Mar 2002 11:17:15 +0100
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] marking DB entries...
Thanks Frank!
Just to be certain, cant I
If two users enter the same
OK so you have 2 tables one for users login and one for the addresses a user
may store and retrieve.
Your users will login, you will validate their name and password combination
and have either a userID or the name is fine too (an integer ID is smaller
to store and possibly more efficient).
Now
Well it's sorta' simple once you get your mind around this - you need two
tables but you've only got one. And there's no OR, you need both to be true
for a site_id ...
The query would be easy if you actually had two tables so we'll search off
of the same table twice giving it different names
You actually have several options here and some things could complicate the
issue too.
A previous poster suggested that 36 page views a second would be
satisfactory - this sounds reasonable but it's also my experience that in
the Windows world the way the systems tend to fail is to become
--
Frank Flynn
Poet, Artist Mystic
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Without knowing what you are trying to do I get the impression you might be
better off doing this via SQL rather than PHP. You say:
...very large result sets, which are transferred to arrays,
and that does some extremely heavy lifting in terms of calculations on those
arrays. By design, it
Well off the top I'd say your forgot the join condition between the
fo_topics and the fo_forums tables. Right now you're counting the Cartesian
product of the two tables.
Also you can't select an aggregate function (like count) and regular columns
without a group by on the same columns.
F
on
, with the question
number, member id and response.
I wish to produce a SELECT query that will find the questions that haven't
been answered by a particular member, i.e. a query that finds the questions
that DO NOT have an entry in responses. How can I do this?
Regards,
Robin
--
Frank Flynn
Poet
Interesting question...
Libraries traditionally use Distillers, The but really this is a hold over
from the card catalogues where if they didn't do it that way the T section
would be over half of the catalogue. Also it's easier for people to notice
that the library puts the the second but
I (too often) find that odd behavior like this is because one of the
variables is set incorrectly (not what I expected) even if it sometimes
works.
A very useful debugging technique is to print out $query just before you
send it to the DB. You might be surprised at what you're sending.
Beau,
I've got two words for you - NOT IN - I'll even show you where those 2
words go:
SELECT students.studentID, students.title, students.fname, students.lname,
students.studentNo
FROM students, theses
WHERE theses.studentID=students.studentID
AND theses.thesisID NOT IN (SELECT thesisID
Jonathan,
You didn't mention which DBMS you're using (Oracle, MySQL, MS SQL, ...) and
the are each a little different but I'll try to solve with fairly generic
SQL:
My personal preference is keep it simple, break up the SQL if it helps (and
I think it would help here).
I'd use a third table,
Rod,
I hope I've got what you're trying to do.
You have a table with a record for each day and columns rate1 and rate2 -
You are trying to collapse the single days into a range where the rates are
the same?
So if I added column titles to your sample report:
Start Endrate1
On 2/11/02 12:12 PM, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
It sounds to me like you are blowing away name in the URL when you submit a
new form.
../index.php?name=My Name
Is just like clicking the submit button on a form with:
action = ../index.php method = get
When you users use a
Miles is correct, this the standard way (without knowing your application
and if I could figure out another trick).
But if you absolutely don't want to use two SQL blocks you can set your SQL
block to something like this:
$sql =
DELETE FROM $table_name
WHERE our_serv = \$our_serv\
INSERT
Hans,
On 2/4/02 6:30 PM, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
From: hz11 [EMAIL PROTECTED]
Date: Mon, 04 Feb 2002 21:17:15 -0500
To: [EMAIL PROTECTED]
Subject: Dealing with One-to-Many SELECTS (MySQL)
to get a single event. This all works fine, however this is the result
On 1/31/02 11:48 PM, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
From: DL Neil [EMAIL PROTECTED]
Reply-To: DL Neil [EMAIL PROTECTED]
Date: Fri, 1 Feb 2002 16:28:16 -
To: Frank Flynn [EMAIL PROTECTED], [EMAIL PROTECTED], Garry Optland
[EMAIL PROTECTED]
Subject: Re: [PHP-DB] Re: Date
Are you guys interested in yet another solution? It simular but I think
it's even easier if that's an incentive...
-In your table do put a datetime field, I'll call it lastMod. This will be
the last updated date and time (you need time here)
-In your form have this as a hidden field so it
, and then average that on a monthly basis. I can't see
that scaling very well, as there might be several hundred breeding records
for a given year, multiplied by 365 days.
Has anyone any hints/pointers for an efficient way to do this?
Regards,
Garry.
--
Frank Flynn
Poet, Artist
There are few things you should consider; perhaps you already have. You may
not be replacing the OS of your Web server but you will be adding a new OS
for the database since MS SQL only runs on Windows. So now your site will
have a Solaris / Apache piece and Windows cluster running MS SQL.
I
Hello all,
I'm having a problem getting PHP to run a query against a MSSQL 7 database.
I have installed PHP, the MSSQL client tools and the php_mssql.dll all
according to the documentation.
PHP will connect to the database just fine. But if I send the query to
execute it will never return, no
59 matches
Mail list logo