[snip]
I have a table with 2 fields: id_from and id_to.
I want to interogate the database and to display the results if the
id_to is equal to some current id OR id_from id_from is equla to saame
current id.
I use this but doesn't work
$sql = "SELECT id_from, id_to FROM ids WHERE id_from ='$curre
The answer to this is quite simple if you look in a manual. mysql_query
returns a resource id from which you extract the results using things like
mysql_result() or mysql_fetch_object() or mysql_fetch_row(). Look up the
manual on those commands.
On Tuesday 24 August 2004 13:24, Phpu wrote:
>
Hi,
I have a table with 2 fields: id_from and id_to.
I want to interogate the database and to display the results if the id_to is equal to
some current id OR id_from id_from is equla to saame current id.
I use this but doesn't work
$sql = "SELECT id_from, id_to FROM ids WHERE id_from ='$current
Curt, thanks, your code works perfectly. Can I ask you two questions?
1. I am not sure what you mean by adding an index. I looked in the mySQL
help files and from what I can figure, I have already done that...
2. Now that the code actually works, we have come up with an issue. When
the curren
Ray Hunter wrote:
On Tue, 2004-05-04 at 19:18, msa wrote:
$query_rsENews = 'SELECT * FROM NewsArchive WHERE YEAR(datePublished) = ' .
YEAR('NOW'()) . ' AND MONTH(datePublished) = ' . MONTH('NOW'()) . ' ORDER BY
sortBy DESC';
this is supposed to return only the records that have the current month an
On Tue, 2004-05-04 at 19:18, msa wrote:
> $query_rsENews = 'SELECT * FROM NewsArchive WHERE YEAR(datePublished) = ' .
> YEAR('NOW'()) . ' AND MONTH(datePublished) = ' . MONTH('NOW'()) . ' ORDER BY
> sortBy DESC';
>
>
> this is supposed to return only the records that have the current month and
>
* Thus wrote msa ([EMAIL PROTECTED]):
>
> $query_rsENews = 'SELECT * FROM NewsArchive WHERE YEAR(datePublished) = ' .
> YEAR(NOW()) . ' AND MONTH(datePublished) = ' . MONTH(NOW()) . ' ORDER BY
> sortBy DESC';
>
> got this error:
> Fatal error: Call to undefined function: year()
>
> any ideas, a
Hello msa,
Wednesday, May 5, 2004, 2:18:57 AM, you wrote:
m> $query_rsENews = 'SELECT * FROM NewsArchive WHERE YEAR(datePublished) = ' .
m> YEAR('NOW'()) . ' AND MONTH(datePublished) = ' . MONTH('NOW'()) . ' ORDER BY
m> sortBy DESC';
m> the above code got a parse error
m> any ideas, anyone?
You
$query_rsENews = 'SELECT * FROM NewsArchive WHERE YEAR(datePublished) = ' .
YEAR('NOW'()) . ' AND MONTH(datePublished) = ' . MONTH('NOW'()) . ' ORDER BY
sortBy DESC';
this is supposed to return only the records that have the current month and
year in the datePublished record.
the above code got
9 matches
Mail list logo