> 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 orderstatu
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 o
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 from
On Jan 6, 2009, at 7:41 AM, [email protected] 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 wh
Good rule - to debug try to run the same command on the command line
of the terminal tool, you'll get better errors.
But I suspect you have not said what the PRIMARY KEY is - typically
you would say: PRIMARY KEY(f_name, l_name)
or perhaps account whatever, it should be unique.
Good Luck,
Fr
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 wonderi
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 tags:
echo " $rmks";
Or replace the \n with ""
$newRmks = str_replace ( "\n", "", $rmks );
echo $newRmks;
You can do this going into or
Ron
You want SELECT DISTINCT ... or SELECT FROM
GROUP BY
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 row;
if all you're after
Geekgirl,
Let me expand on the answers so far...
There are two things you can do here: add a new record or update an
existing one. In SQL this makes a big difference and in your
question you've confused the two (MySQL has a trick which kind of
mixes the two and it is limited). I'm not ex
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 code
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 my
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 bel
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 are
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 -
abilities). But think of cursors just like your
results set - you define them by running 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
ns1 (ID INT NOT NULL AUTO_INCREMENT,name VARCHAR(30),day
> TIMESTAMP,question TEXT,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/unsub.php
name of thread creator
> threadtitle // title of thread
> sticky // not implemented yet
> closed // not implemented yet
>
> #TABLE hf_posts:
> postID // ID of post
> threadID // ID of thread where the post belongs
> userID // ID of poster (for perms reasons)
>
--
> | Category = 2nd $Category
> -------
> | $Model - $Description - $Price
> ---
> | Category = 3rd $Category
> ---
> | $Model - $Description - $Price
> -
>
> I think that I can do this
> with a nested array... 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
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
y["title"];
> $datum= date("d-m-Y", strtotime($datum));
> $datum is 20-02-2004
> ?>
> I want to show here the events by month for example table with events of
> 02(February) then if there are events from 03(March) another table and so
> one
> How can I make this work do I need to make 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
#x27; doesn't work, use
> like '%value%'
>
> Hop that helps
> Nitin
>
> ----- Original Message -
> From: "-{ Rene Brehmer }-" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, February 24, 2004 11:57 AM
> Subject: [PHP-DB] 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
in MS SQL getdate().
- Have your Stored Proc return only the web_user value to PHP.
Now run a new query on the table where web_user = the value you just got.
Your "Next 10" button only needs to store the web_user value and the number
of the row you're on now. If you need some s
es and classSections
> where classDeleted=0
> and group by classCode
>
> tables below
>
> CLASSES
> classID
> classDescription
> classTexts
> classCost
> classDeleted
>
> CLASSCODES
>
> classCodeID
> classID
> classCodeSection
> classDate
> classTime
> classLocation
> classInstructor
>
> I'm going nuts trying to get this. I 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 ta
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,
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 s
> cnt,species.name,pets.species from pets,species where
> species.id=pets.species group by pets.species order by cnt desc limit
> 1". Now, the speed of the page loading 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
101*/
>
> Which gives:
> +---+
> | TDbl_SlabRate |
> +---+
> | 80.00 |
> +---+
>
>
> I would ideally like to combine this into a single nested SQL query, however
> all my attempts at that have failed, and I remember reading somewhere that
> MySQL does not support nested SQL queries. Is a single query possible?
>
>
> Cheers,
> -Srini
> --
> http://symonds.net/~sriniram
>
--
Frank Flynn
Poet, Artist & Mystic
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
way for me in PHP4 to add all the contens (floating numbers) 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
Po
Hi Dave,
The easiest, most direct, ANSI - SQL way to do what you ask is:
SELECT count(*) as num_posts, Admin_id
FROM <>
WHERE <>
GROUP BY Admin_id
ORDER BY Admin_id
This will give you:
num_posts Admin_id
-
3 1
4 2
5 3
And naturally you
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 w
t; passwords but what I don't know is how to protect the pages not to be seen
> without authorization. At first I thought about the .htaccess 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 expla
On 4/20/02 6:10 PM, "[EMAIL PROTECTED]"
> From: "Jeff Oien" <[EMAIL PROTECTED]>
> Subject: DISTINCT Question
>
> How can I do a query for a distinct field plus get the info from
> other fields?
DISTINCT and GROUP BY are your two choices. But they have particular rules
>I tried this:
> select
link); //JUST CRASHES ON THIS LINE
>
> $r = mssql_rows_affected ( $link);
> print("rows affected was $r");
>
> $close = mssql_close ($link);
> print("close was $close");
>
>
> =
> I run IIS4, NT4 (SP6a) and SQL 7 on the same m
> -Lisi
>
Oh, sorry each database is different 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 Enterp
---
>>
>>
>>
>> if ($quantity == 0)
>> {
>> $gone = mysql_query("DELETE FROM {$config["prefix"]}_my_items WHERE
>> uid={$session["uid"]} AND id = '$item'");
>> }
>>
>>
>>
--
Frank Flynn
Poet, Artist & Mystic
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
t;[EMAIL PROTECTED]> wrote:
> fopen()
> fwrite()
> fclose()
>
> -Original Message-
> From: Raymond [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 08, 2002 12:05 PM
> To: Frank Flynn; [EMAIL PROTECTED]
> Subject: [PHP-DB] Re: Making a txt file from db data, is it possible?
&
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 addre
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 i
hours know but cant get the twin check to work.
>
>
>
> Can get single check to work though.
>
>
>
> I thank you in advance for any thoughts or code examples
>
>
>
> Dave Carrera
>
> Php Developer
>
> http://davecarrera.freelancers.net
>
> http://www.davecarrera.com
--
Frank Flynn
Poet, Artist & Mystic
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
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 u
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 eac
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 unstabl
mt);
> $age_4 = $row->c;
>
> This returns only the value for 4. To get all values (10 different ones) I
> would have to make 10 querrys, right?
>
> Is there a faster way?
>
> Thanx for any help,
>
> Andy
--
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 3
nswered 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, Artist & Mystic
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
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.
Personal
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 thesisI
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 ra
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, it
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 us
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
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
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 ge
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 PROTECTE
Gary,
You have a right to be confused - this problem is short but it is about as
complex as they get. Still I have a solution for you, also short and you'll
(hopefully) find it elegant. I found it interesting...
The thing is we will create a Cartesian product on purpose - this is
something the
ll, 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 & Mystic
--
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]
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
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 ha
66 matches
Mail list logo