Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Help with if condition ** SOLVED **
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



Report this thread to moderator Post Follow-up to this message
Old Post
tox_yray
08-18-04 08:57 PM


Re: Help with if condition ** SOLVED **
Foget 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



Report this thread to moderator Post Follow-up to this message
Old Post
tox_yray
08-18-04 08:57 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP SQL archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 04:41 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.