Code Comments
Programming Forum and web based access to our favorite programming groups.Ok, here what I want to do is to put a condition of displaying for a
string.
If the number of entries is 1, put it singular.
If it is over, put it plural.
Here is the parcel of code: --------
for (i=0; i<sizeof(diplomes);
i++)
{
select = "SELECT * FROM "
.langue. tables[i] . " WHERE ancien
=0";
result =
mysql_query(select,db);
total =
mysql_num_rows(result);
if(total)
{
etudiant=
mysql_fetch_array(result);
stagedocnum = "SELECT *
FROM" . langue. "stage_doc WHERE ancien =0";
reqstagedoc =
mysql_query(stagedocnum,db);
comptestagedoc =
mysql_num_rows(reqstagedoc);
url =
"etudiants_actuels.php" . "?lg=" . lg .
"&table=" . tables[i];
echo '<a href="' .
url .'">';
if(comptestagedoc > 1)
{
}
elseif(comptestagedoc == 1)
{
diplomes =
str_replace(memb_labels['Stagiaires
doctoraux'], memb_labels['Technicien'],
diplomes);
}
echo '<strong class=
>'
.comptestagedoc.
memb_labels[diplomes[i]] .
'</strong>';
echo
'</a><br><br>';
}
--------
The problem is that it just does not work (comptestagedoc it
returns nothing, i know that because I echoed it in the code to see
if it was the problem: look at the before last echo... I t only
echoes memb_labels[diplomes[i]])
Now I heard that my version of MySQL could be the problem. I run MySQL
3.23.58. Now is there a way to correct this and make this prcel of
code work?
Thanks,
Bruno M-A.
----------------------------------------
The post originated from PHP Freaks:
----------------------------------------
http://www.phpfreaks.com
http://www.phpfreaks.com/forums
Post Follow-up to this messageFoget about that, if was the reqstagedoc that ws not working.... ---------------------------------------- The post originated from PHP Freaks: ---------------------------------------- http://www.phpfreaks.com http://www.phpfreaks.com/forums
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.