ype LIKE '%$listing_type%'
AND listing_approved IN ('1', '2')
ORDER BY name ASC
Good luck!
-TG
- Original Message -
From: "ron.php" <[EMAIL PROTECTED]>
To: php-db@lists.php.net
Date: Sat, 15 Sep 2007 15:04:59 -0400
Subject: [PHP-DB] Query syntax
r condition is the same in both statements, reducing potential
errors.
This is just a quick and dirty example, not adhering to any real design
scheme. My normal code is a bit prettier than this, but you get the idea.
-TG
- Original Message -
From: "endro mei a." <[EMAIL PROTECT
e or not though.
You'd have to do some tests.
Also, comparisons like "=" should (if I recall) be faster than LIKE
comparisons. So if you really meant to use "=", do that instead.
Let me know if any of that's unclear. I know I get some kooky ideas
sometimes. Also, an
1);
$result2 = mysql_query($somequery, $conn2);
Something like that.
-TG
- Original Message -
From: "Derek" <[EMAIL PROTECTED]>
To: php-db@lists.php.net
Date: Thu, 27 Sep 2007 16:42:10 -0500
Subject: [PHP-DB] Updating 2 Databases from a single form
> Hello,
>
>
custD 3
Then it's just a matter of drilling down, collecting a list of ID's for that
customer and the sub-customers.
Lotsof ways to tackle this problem.
-TG
- Original Message -
From: nhadie <[EMAIL PROTECTED]>
To: php-db@lists.php.net
Date: Fri, 28
for a customer doesn't use characters
that are bad for table names.
What kind of data are you thinking about storing for your customers and your
customer's customers? And what other data do you need to store for
whatever your webapp does?
-TG
- Original Message -
From: nha
ibly wrong and give a better solution, please enlighten. Always
willing to learn new things if they are, indeed, better.
-TG
- Original Message -
From: "Bob Chatman" <[EMAIL PROTECTED]>
To: TG <[EMAIL PROTECTED]>
Cc: nhadie <[EMAIL PROTECTED]>, php-db@li
risons with NULL), you have to use "WHERE
DepartmentID IS NULL".
-TG
- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>,
Date: Wed, 3 Oct 2007 05:21:06 -0500
Subject: [PHP] the opposite of a join?
> I have a company table and a contacts t
The most common method I've seen is with Javascript. onsubmit, disable
submit button.
As a backup, in case the user's JS is disabled, you might consider the unique
ID thing.
-TG
- Original Message -
From: "T K" <[EMAIL PROTECTED]>
To: php-db@lists.php.ne
see, there is some kind of case for allowing non-unique input into the
database, depending on the circumstances.
-TG
- Original Message -
From: OKi98 <[EMAIL PROTECTED]>
To: T K <[EMAIL PROTECTED]>
Cc: php-db@lists.php.net
Date: Fri, 05 Oct 2007 10:34:50 +0200
Subject: R
Along with the formal inner join syntax Bastien pointed out, isn't doing
"WHERE t1.id = t2.id AND t2.id = t3.id" the same thing?
select [table.field]
from
table1 t1, table2 t2, table3 t3
where t1.some_field = t2.some_field
and t1.some_field = t3.some_field
-TG
- O
-you-wanna-call-them are used to be
explicit with a name.
-TG
- Original Message -
From: "Gary Wardell" <[EMAIL PROTECTED]>
To:
Date: Thu, 13 Dec 2007 19:33:57 -0500
Subject: RE: [PHP-DB] UPDATE syntax
> Hi,
>
> I'm a beginner at PHP and MySql but a long
You might check the google documents api:
http://code.google.com/apis/documents/overview.html
-TG
- Original Message -
From: ioannes <[EMAIL PROTECTED]>
To: php-db@lists.php.net
Date: Wed, 26 Dec 2007 23:59:12 +
Subject: [PHP-DB] Download google spreadsheet
> I would li
bout any PHP issues too.
Assuming your MySQL server is on another server, if you have a Windows
machine you can use a program like WinSQL Lite or Navicat to connection to
the MySQL server (if it allows remote connections).
phpMyAdmin is probably the easiest option though.
-TG
- Origina
r be generated by
PHP or the database? Or can it be either?
-TG
- Original Message -
From: "A. Joseph" <[EMAIL PROTECTED]>
To: "Evert Lammerts" <[EMAIL PROTECTED]>
Cc: "php-db@lists.php.net"
Date: Thu, 17 Apr 2008 00:00:21 +0100
Subject: [PHP-
load on the server than you need
to put on it.
Anyway, just some thoughts. See if anyone else responds, do some reading,
etc. Sounds like you're in a good position since your company is small.
Probably can't do too much that's going to cause a mess in the future. hah
G
ce would be appreciated. I know my way around a
database or two and know a few things about optimization, but I need some
solid evidence to throw at this web host so they'll listen to me. They're
usually really awesome, but this case is causing me to lose my hair.
Thanks in adva
That's the other thing that's driving me nuts. They get traffic,
but it shouldn't be so much that it's causing issues ilke this.
Shouldn't have to make such radical changes for this site. All I can think
is that it's an issue with their server and/or other custom
- Original Message -
From: Afan Pasalic <[EMAIL PROTECTED]>
To: TG <[EMAIL PROTECTED]>
Cc: php-db@lists.php.net
Date: Wed, 05 Nov 2008 17:07:46 -0600
Subject: Re: [PHP-DB] Joomla MySQL query performance affected by anything
non-server related?
> TG wrote:
>
ly weird, since their support is usually great. Maybe it's just their
database guys who don't want to work.
-TG
- Original Message -
From: "Fergus Gibson" <[EMAIL PROTECTED]>
To: php-db@lists.php.net
Date: Sun, 9 Nov 2008 11:09:22 -0800
Subject: Re: [PHP-DB] Joom
ng one "connect" at the head
of your script and closing it at the end of the script execution isn't a
big deal. But you won't be able to pass the connection information via
session variables.
-TG
- Original Message -
From: Fred Silsbee
To: php-db@lists.php.net
s probably good to try to structure things so you have a predictable and
controllable way so you know whether you're going to be getting GET or
POST data. Some cases required 'either' but in general, one or the other
should be good enough if your code is structured properly.
-T
;t know if that helps, but just to add to the
list of "how *some* people do it".
Good luck!
-TG
- Original Message -
From: listread
To: php-db@lists.php.net
Date: Mon, 02 Nov 2009 07:16:23 -0600
Subject: [PHP-DB] How to: Include identifier with a query
> Greetings!
>
&g
The only issue I see and maybe why they'd disable it is so you don't do a
crazy join that ends up returning 8 billion rows. But they should be
able to manage that with query execution time timeouts or something and
you can do the same thing with bad implied inner joins in the WHERE
clause anyw
d?)
and just using the numbers is the one big instance that strtotime() breaks.
Hope this helps. You should be able to get whatever date format you need now.
-TG
*** new email address [EMAIL PROTECTED]
*** old email address [EMAIL PROTECTED] YAY CHAPTER 11! :(
= = = Original message = = =
Hi
I
+ mktime(). I think
date/mktime gives you more reliability and more flexibility. Just something
to think about. When it comes down to it, whatever works for you, right? :)
-TG
= = = Original message = = =
Thank you for all your help.
Among all the variations I found this to be
...
"0002"
(integer versus a string?)
If so, the === should work I believe. It should compare variable types as well
as values so it shouldn't convert "0002" to just 2 before doing the evaluation.
Good luck!
-TG
= = = Original message = = =
Hi List,
I was comparin
er it again by hand... something to keep them from being too lazy
and always entering a new address.
Good luck Matt!
-TG
= = = Original message = = =
We have about 20,000 addresses in our database.
If my users are filling out a form that requires an address already in our
database I have
he lookup of "SE
Akron" and know that's actually Akron and not some suburb of Chicago or
something, then you're going to have to tell it yourself. I think this is the
best solution for you.
Best of luck!
-TG
= = = Original message = = =
Hi there everyone,
I~m usin
r
things like that.
Again, maybe I mis-assuming what your configuration is. Mind giving us more
detail on the process you're trying to fix? Users connects to web server, web
server makes ODBC connection (by what means?), etc..
-TG
= = = Original message = = =
Hi,
I have an intranet applicat
n turn actually handles the connection.
Don't know if that helps, but that's the next place I'd check, unless someone
else has better insight.
-TG
= = = Original message = = =
Thanks for the response!
Yes, believe it or not it does work, or at least did on IIS 5. When I
turn on
.3.4
Any tricks, tips or philosophical and/or theoretical things I've just not
seeing, please let me know.
Thanks
-TG
___
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.
--
PHP
DSN config file. Down here it says "Cargo System databases" you'll
find examples that might help. Sorry to be vague, but hopefully it's a start
for you. Once you get it configured, it should work fairly fluidly.
-TG
= = = Original message = = =
I have been asked by my
son doesn't affect output but will make your case
sensitivity issue moot.
HTH
-TG
= = = Original message = = =
Hi there everyone,
I have a little problem, I have a search where people can search the address
of a property BUT the search is case sensitive, I don~t WANT it to be.
parately, you only
have to check this function, not all your lines of code.
If someone has better ways of doing this, I'm all for hearing it. Please opine
or criticize what I've posted above too. I want to learn as well.
-TG
Code:
* Modification Log:
* -
ks for pointing that out. Now off to find my newer version and make sure I
chaned it there too.
-TG
= = = Original message = = =
no !!!
mysql_real_escape_string()
anyhow.. good luck with your security endeavors!
On 8/25/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> I'm pr
; way to do it.
If that's what you need to do though, definitely check out serialize (unless
someone knows something I don't).
Serialize() should do essentially what's being proposed below, just without
having to figure out what string may not be in your array.
good luck!
-TG
ter though.
-TG
= = = Original message = = =
Yes, this has been mentioned in this thread. But with serialize/
unserialize, you can run into other problems that may be more
confusing/difficult to troubleshoot. e.g.:
http://www.php.net/serialize
> >As you can see, the original
error is and then we can figure out how to fix it. Probably a typo in a
query, variable name or table name I'm guessing.
Let us know if you find anything else out.
-TG
= = = Original message = = =
After adding echo mysql_error(); I get the same result. I tried changing
the query to i
songs and want all artists who've covered it to point to the same SongID data.
This way you can:
SELECT * from ARTISTS
for your ARTISTS box
Then once an artist is selected, do a:
SELECT * from SONGS where ARTISTID = $artistid
Just some ideas.
Forgive the pseudo-code and mixed c
onthText = date("F", mktime(0, 0, 0, $i, 1, 2000));
if ($i == $monthNumber)
$selected = " SELECTED";
else
$selected = "";
echo "$selectMonthText\n";
echo "\n";
-TG
= = = Original message = = =
I am trying to format the month portion
have any doubts/questions.
-TG
= = = Original message = = =
use the nl2br() function to convert the newlines to
bastien
>From: Alex Major <[EMAIL PROTECTED]>
>To:
>Subject: [PHP-DB] Formatting a form box
>Date: Thu, 12 Jan 2006 16:33:01 +
>
>Hi there,
>On one o
a way to convert at least the valid date/time pairs into a happily ORDER BY'd
column. I can handle the -00-00 and N/A entries with exceptions if I need
to.
And I would really like to do this without pre-loading the data into PHP and
sorting it with PHP
s meant to work on separate date and
time fields in the following formats:
ApptDate: -MM-DD (we at least did that part 'normal')
ApptTime: HH:MM [AM|PM]
Thanks for the response though Stephen... always worth going over the simple
stuff first. :)
-TG
= = = Original message =
PM', '%Y-%m-%d %H:%i:%s')
duh... hah. Thanks! I knew it was something simple.
-TG
--
What's wrong with [using] this?
mysql> select str_to_date('2005-10-27 07:00 PM', '%Y-%m-%d %l:%i %p');
+
xpires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always
modified
header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
header("Cache-Control: post-check
uot;); // always
modified
header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false); // HTTP/1.1
header("Pragma: no-cache"); // HTTP/1.0
good luck!
-TG
= = = Original message = = =
Hi,
05;
echo date("Y-m-d H:i:s", mktime($hour, $minute - 90, $second, $month, $day,
$year));
It will even adjust for leap years I believe. You can add/subtract/etc any of
those items and it's smart enough to figure out what the correct resulting
date/time would be.
-TG
= =
efficient and
accurate and this is on the list of things to doublecheck. If anyone has any
comments, criticisms, information, etc... I'd love to hear them.
We're running MySQL 4.1.11-standard.
Thanks!
-TG
___
Sent by ePrompte
ch and not "monetary". I think that's the
keyword that would have done it for me.
I appreciate the help guys! Best of luck to both of you (and anyone else I
inadvertantly missed who may have responded).
-TG
= = = Original message = = =
Me again,
Sorry for the rtfm stuff
;re dealing with 15k rows still, so you probably want something a
little more automated.
Without more info though, it's hard to say exactly what can be done.
Hope that helps a little bit.
-TG
= = = Original message = = =
My dear beloved friends,
I have a catalog of products that a produ
Haha.. oh yeah.. DISTINCT works too.. in this case you'd get a list of all
totally 100% unique records.
If you had an auto_increment column though, you'd want to exclude it from the
list.
-TG
= = = Original message = = =
SELECT DISTINCT * FROM `tablename`
On Wednesday 01 March
ong in case it was useful.
-TG
= = = Original message = = =
I know this may be a bit off-topic, but I would like to use the PEAR library
to implement some of my database functions. Unfortunately, the PEAR
documentation is woefully incomplete and as a result i've been unable to
install it pr
cel file format spec.. maybe through the OpenOffice
sources.. and figure out how to read XLS files that way.
The Excel Object Model might help you with the proper properties/methods/etc:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_wrcore/html/wrgrfexcelworkbookobject.asp
Go
figure out how they do it (if at all) but I'm guessing
it's not going to really be feasible for you to do this... not easily at least.
-TG
= = = Original message = = =
Hi all,
I am developing the site using php and mysql. I have to add the url at
google site through php code.
If any
s to try to isolate if
it's the query or your PHP.
Good luck!
-TG
= = = Original message = = =
I am trying to write a script to handle event registration. Most of the
people that will be registering are already in the database, but not all,
and those that are may not have current informat
hen when you go to do your output, you'd do something like this:
forach ($dvdarr as $callnumber => $dvddata) {
$title = $dvddata['Title'];
$publisher = $dvddata['Publisher'];
$comments = $dvddata['Comments'];
foreach ($comments as $comment) {
// do wh
figure out how many 30 minute
periods have occurred between the timestamp and now and update the gold then.
The cron job is preferrable but if you're looking for alternate ideas, there's
one for ya.
Good luck!
-TG
= = = Original message = = =
Hi there.
I've posted this up on
here may be some tricky ways in SQL to get the data the way you want it, but
ultimately it's not worth the bending over backwards for (do I remember right
that you can do it with crosstab queries? don't even know if MySQL will do
those properly). Easier just to do it with one of
s an example of how to do it in MySQL:
http://dev.mysql.com/tech-resources/articles/wizard/index.html
But again, not what the original poster was looking for.
-TG
= = = Original message = = =
google 'cross tab queries'...there is a php/mysql example (sorry travelling
and don't
cause very minimal
impact on your system. Sometimes two queries are better than one.
-TG
= = = Original message = = =
I see they call mysql_query twice which doesn't look like I'm gaining
anything over running the 2 queries:
SELECT count(*) as MyCount FROM aTable
SELECT * FROM aTable
s the database check.
You could probably get the last inserted ID number as well and pass that to the
PHP script if you want to check specific records right after they're inserted.
-TG
= = = Original message = = =
I have an Access database connecting via ODBC to a local MySQL machine
ested and unsubscribe using one
of your email addresses and see if that solves the problem.
-TG
On 7/7/06, Karl James <[EMAIL PROTECTED]> wrote:
>
> Team,
>
>
>
> I am still receiving duplicate emails.
>
> I check with my ISP and they tell me it is
>
> Not th
al values, but it doesn't change what appears
in your results. This only affects the sorting:
select * from sometable order by if(ifnull(somecolumn, '') = '',
'ZZZZ', somecolumn)
Hope that helps.
-TG
= = = Original message = = =
I have this c
al values, but it doesn't change what appears
in your results. This only affects the sorting:
select * from sometable order by if(ifnull(somecolumn, '') = '',
'ZZZZ', somecolumn)
Hope that helps.
-TG
= = = Original message = = =
I have this c
x27;s able to UNION them
together.
Also, less code/typing typically means less chance of typos.
BTW: In my example, realistically you could probably shorten the morphed value
to "ZZ" or "ZZZ" unless you think you'll values in your database that will
start with "ZZ
random data sources I had to from
time to time.
http://adodb.sourceforge.net/
Sorry I don't have time to look for good examples, but maybe the documentation
will help out some and get you on the right path.
-TG
= = = Original message = = =
I cannot connect to my MSSQL server.
I us
get zero results.
You really don't need to use the mysql_affected_rows() either unless you want
to test for zero results and display an error message, like I believe you
wanted to do.
-TG
= = = Original message = = =
Hi,
The below mentioned code works fine. Connects to the database, fetches
If all you want is a unique list of "adr_one_region" codes, then use the
DISTINCT keyword in your SQL:
SELECT DISTINCT adr_one_region FROM egw_addressbook WHERE cat_id='8' ORDER BY
adr_one_region
-TG
= = = Original message = = =
Hello everyone
I'm back wor
Not sure if this is exactly what you're looking for, Matt, but I think it is.
If that's not right, please re-describe the problem and let's see what we can
figure out.
If you have questions about what/how/why/etc... feel free to ask.
-TG
= = = Original message = = =
Hel
o "Supplier: $name has CONTACT_VALUE = $value\n";
}
There may be an elegant way to do what you want in SQL too, I'm just not fully
groking the situation I think.
-TG
> $name = $row['NAME'];
> $business = $row['BUSINESS'];
> $address = $row
Try this as your SQL. It should give you all the results, then you can use PHP
to sort it all out.
SELECT * FROM egw_cal WHERE cal_category='501' and cal_id in (SELECT cal_id
FROM egw_cal_dates where cal_start > $tstamp)
-TG
= = = Original message = = =
Hello Everyone
e "n"
echo date("n", strtotime($subscription_begins));
http://us3.php.net/manual/en/function.date.php
-TG
= = = Original message = = =
I have a $subscription_begins variable. It the date type. -MM-DD
How may I find out the month value (1
e alnum class or an underscore (_).
mysql> SELECT 'a word a' REGEXP '[[:<:]]word[[:>:]]'; -> 1
mysql> SELECT 'a xword a' REGEXP '[[:<:]]word[[:>:]]'; -> 0
-TG
= = = Original message = = =
Hi all,
I'm setting up a data
"s first, sorting them by first/last, then put everyone else
after the "Bob"s sorted by first/last.
If you don't put DESC on the 'Cats', it looks like it'll put the 'Cats' at the
bottom of the list.
Also refer to the user comments here:
htt
ff, but just to demonstrate the point:
SELECT * FROM productgroup WHERE groupid = $productid
ORDER BY IIF(label = 'Cats', 0, 1), title
Was that MS SQL or just Access that used IIF? (immediate IF.. wtf is an
'immediate IF' anyway?)
-TG
= = = Original message = = =
I think the
SELECT MIN(id), MAX(id) FROM mytable
:)
Hope that helps!
-TG
= = = Original message = = =
I have a table where I need to figure out the very first ID and the
very last ID, so here is what I wrote:
$first_query = "SELECT id FROM mytable ORDER BY id LIMIT 1";
$first_result = m
able names:
SELECT l.LeadID, ld.FirstName FROM Leads as l, LeadData as ld
WHERE l.LeadID = ld.LeadID
(actually a lot of the time you can leave out the "as" and just do "Leads l")
Fun times..
-TG
= = = Original message = = =
<[EMAIL PROTECTED]> wrote in message
news:[EMA
78 matches
Mail list logo