Hello Marcjon,
do this:
SELECT forumusers.*, forumuserprofiles.* from
.$godlyness['database_database']..forumusers
LEFT JOIN .$godlyness['database_database']..forumuserprofiles ON
forumusers.username = forumusersprofiles.username where order
by
so.. if you do: where
Yeah, I think I am going to reconsider the software
box. The idea I have now is to have an Add Expert
link attached to each software entry, which will then
load a page to add experts to that piece of software.
The page could contain two select boxes, one with a
list of all experts, and one with a
But how do I populate the array with (for e.g.) 2
fields from a mysql table. Each line of the select box
needs to hold the Name and Version of the piece of
software, the results from a:
select Name, Version from software
-s-
--- Corne' Cornelius [EMAIL PROTECTED] wrote:
You have to give the
I'm not sure if anyone answered this for you, and perhaps I'm missing
something. Are you simply trying to populate a multi-select box with
MySQL data?
If so, try this:
echo form tag here...
echo SELECT NAME=\software[]\ MULTIPLE SIZE=5;
$query=select ID, Name, Version from software;
You have to give the Mutli select box a name as an array. eg:
SELECT NAME=experts[] MULTIPLE SIZE=5
OPTION VALUE=key1val1/OPTION
/SELECT
then in PHP, you can access $experts as an array.
while (list ($key, $val) = each($experts)) {
print $key = $valBR\n;
}
Jason End wrote:
I writing a
use select name = 'listbox1[]' multiple
this will send an array to your script.
|---|
| Jeff | KeaneIT - Presidents |
| Landing | Suite: 200 |
|Outside: 617 -517-1772 | |
| E-mail: [EMAIL PROTECTED] |
|[ Mailing: 10 Presidents |
|
rename your select lists with array brackets at the end
'listbox1[]'
all of your values will be passed to the next page as an array
-Original Message-
From: Wilmar Perez [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 01, 2002 12:47 PM
To: php-db mailing list
Subject: [PHP-DB]
On Thursday 01 August 2002 17:06, Dave Carrera wrote:
Hi All
I have a situation where I need to do select on my mysql db.
Here is what I am trying to do
Select * from table_name where col1=1 and col2=1 and col3=0
But this refuses to work.
How does it refuse to work? Any error messages?
$query = SELECT myvalue FROM mytable WHERE some_condition;
$result = mysql_query($query) or die(Error: .mysql_error());
$srch = ;
while( list($myvalue) = mysql_fetch_array($result)
{
$srch .= $myvalue, ;
}
$srch = substr($srch, 0, -2);
$query = SELECT * FROM other_table WHERE this_val
Try creating your input with names that php will create arrays from, then
you can simply join the array elements if they are non-empty with something
like OR $key='$val'.
An example:
form
input type=text name=filter[haircolor]
input type=checkbox name=filter[registered] value='Y'
/form
In HTML:
SELECT name=manufacturernames[] multiple
(note the name has PHP-like array definition)
In PHP:
for ($i=0;$isizeOf($manufacturernames);$i++) {
if ($i==0) {
$q_cond=where;
} else {
$q_cond=or;
}
$query.=$q_cond MANUFACTURER LIKE '$manufacturernames[$i]';
}
Gisele Grenier
Bogdan Stancescu wrote:
In HTML:
SELECT name=manufacturernames[] multiple
(note the name has PHP-like array definition)
In PHP:
for ($i=0;$isizeOf($manufacturernames);$i++) {
if ($i==0) {
$q_cond=where;
} else {
$q_cond=or;
}
$query.=$q_cond MANUFACTURER LIKE
12 matches
Mail list logo