Here's an easy one that I can't find laid out for me anywhere:
I want a self join that pairs up the id numbers of a table in every
permutation
e.g. i have id #s 1, 2, and 3
i need this result:
1 2
1 3
2 1
2 3
3 2
3 1
clear enough?
--
PHP Database Mailing List (http://www.php.net/)
To unsubscr
G'day Chris
> I have 3 fields, city, country, type
> I also have an imput box where you can type in a search word. What I need is,
> say you type in hotels germany, I need the search to break up the sentence and
> then search each 3 fields in the DB looking for a match.
> So, for example: it wou
On Sunday 31 March 2002 13:07, Chris Payne wrote:
> Hi there everyone,
>
> I do this to explode my input line which consists of however many words:
>
> $words = explode(" ", $testb);
>
> Now i've done this and I presume that $words holds all the info as an Array
> (new to arrays, sorry if i'm wron
$words[0] would be the first word, $words[1] would be the second word...
$words[10] would be the eleventh word, etc, etc
-Original Message-
From: Chris Payne [mailto:[EMAIL PROTECTED]]
Sent: Saturday, March 30, 2002 9:08 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Probably a stupid Array
Hi there everyone,
I do this to explode my input line which consists of however many words:
$words = explode(" ", $testb);
Now i've done this and I presume that $words holds all the info as an Array (new to
arrays, sorry if i'm wrong) however, how can I put each item of the array from $words
Hmm to do a search on one table it might actually be quicker to do a query
for every thing in the query. First convert to all lowercase. Then explode
the query into an array using " " as the delimiter. Then implode this array
into a list that looks something like this. "var1","var2"...) you c
Disclaimer: Its late, I'm tired and I haven't tested this code. Hope it
helps.
Quick Overview:
//make your dictionaries all lower case for ease
$countries = array( 1 => 'us', 2 => 'germany', 3 => 'australia' );
$cities = array( 1 => 'new york', 2 => 'berlin', 3 => 'sydney' );
$lodging = array(
Hi there everyone,
How can I accomplish the following?
I have a table called search,
I have 3 fields, city, country, type
I also have an imput box where you can type in a search word. What I need is, say you
type in hotels germany, I need the search to break up the sentence and then search
on 3/30/02 6:33 PM, wesley grubbs:. at [EMAIL PROTECTED] appended the
following bits to my mbox:
> foreach($_POST["del"] as $val) {
>
> $sql = "DELETE FROM $tablename WHERE id = $val";
Be very careful with this. If a user spoofs the form and adds the value for
del like this:
Would make the
You can go one better than this, even...
use PHP to construct a single SQL query
using the IN( ) comparator, ie:
"Olinux" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> to make it a little better, make one connection to the
> db before you loop and then clo
to make it a little better, make one connection to the
db before you loop and then close the connection
[connect]
foreach loop
[close connect]
olinux
--- "wesley grubbs:." <[EMAIL PROTECTED]> wrote:
> thanks guys for the aid.
>
> in the end, i went with creating a check box that
> looks like t
thanks guys for the aid.
in the end, i went with creating a check box that looks like this:
and the dirty work of deleting it looks like this::
foreach($_POST["del"] as $val) {
$sql = "DELETE FROM $tablename WHERE id = $val";
...connect to database.. run $sql.. close db.. yadda yadda..
}
On Sunday 31 March 2002 03:17, andy wrote:
> Hi there,
>
> I know that there is a command lock table but what if I have hundrets of
> tables and want to copy them for backup.
>
> How could I lock the entire db and flush all tables?
Have a look at the manual for whatever database you're using.
-
Hi there,
I know that there is a command lock table but what if I have hundrets of
tables and want to copy them for backup.
How could I lock the entire db and flush all tables?
Thanx for any help,
Andy
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php
I believe what you want to do is create an array with the id and delete as
separate values.
Here's an example using an array of studentdata containing variables
send_mail, this_studentname, this_paid.
The rows of students are output like this:
In this case all o
One way you could do this. Is have the form point to itself i.e. $PHP_SELF,
then set a variable in the form if it is set when the page loads the run the
form processing script. As for the delete function one way to do it would
be since you are holding the checkboxes in an array. Do a while or a
i've been playing half the day with trying to get php to delete rows when a
checkbox is checked.
i have a page that pulls all the data from db in a table. one row contains
checkboxes. i want it so that whereever a checkbox is checked and then
submit, all the selected rows will be deleted.
For the future, run this very simple and make sure that MySQL support (or
whatever is part of your build).
Scott
-Original Message-
From: CK Raju [mailto:[EMAIL PROTECTED]]
Sent: Saturday, March 30, 2002 7:40 AM
To: Saulo Silva; [EMAIL PROTECTED]
Subject: Re: [PHP-DB] Problem with PHP
On Saturday 30 March 2002 08:12, Saulo Silva wrote:
>Hi everybody
>
>I can't get PHP to work with mySQL. I'm using PHP as an Apache module
>(RedHat) and the error message I get is the following message:
Check out all the mysql- rpms and install the correct ones. They would
work, if you can l
19 matches
Mail list logo