Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Showing variable value in php....
Old 03-03-2010, 01:41 AM Showing variable value in php....
Isabella_Smith's Avatar
Ultra Talker

Posts: 285
Trades: 0
Hi forum,

you guys are really helpful............and that's why I ask all of my queries here.

Now I am having a problem............I want to show a variable value at the top of the page but the problem is the code is executing at the middle of the page.

example:

PHP Code:
$sno_22 0;
                      if(
$tot_record 0)
                      {
                      while(
$row_c=mysql_fetch_array($result_c))
                      { 
                        
$sno_22++;   // I want to show this value

                        
if($sno_22%3==1)
                        {
                   
     if(
$row_c['biz_plan']==1)
                   { 
Any help would be appreciated.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE



Please login or register to view this content. Registration is FREE
buy all indian salwar Kameez, Sarees and clothes
Isabella_Smith is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-03-2010, 02:13 AM Re: Showing variable value in php....
MattGoucher's Avatar
Skilled Talker

Posts: 64
Name: Matt
Location: California
Trades: 0
With that small piece of code, its a bit hard to see whats going on but, In my opinion, I would do something like this, give it a try.
PHP Code:
$sno_22 0;
                      if(
$tot_record 0)
                      {
                      while(
$row_c=mysql_fetch_array($result_c))
                      { 
                       
$NewVar =  $sno_22++;   // I want to show this value

                        
if($NewVar%3==1)
                        {
                   
     if(
$row_c['biz_plan']==1)
                   { 
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Invalid Code On A New Website Is Like Having A New Car With A Broken Windshield
MattGoucher is offline
Reply With Quote
View Public Profile Visit MattGoucher's homepage!
 
Old 03-03-2010, 02:13 AM Re: Showing variable value in php....
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
Is there any reason why you can't do the processing before rendering your output? In general, you should try to separate the logic of a program from its output. If you mix it all together things get sloppy very easily.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 03-03-2010, 03:16 AM Re: Showing variable value in php....
Isabella_Smith's Avatar
Ultra Talker

Posts: 285
Trades: 0
Thanks....nullpointer......you are right......I've to use another string for that....BTW....thanks both of you.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE



Please login or register to view this content. Registration is FREE
buy all indian salwar Kameez, Sarees and clothes

Last edited by Isabella_Smith; 03-03-2010 at 03:19 AM..
Isabella_Smith is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Showing variable value in php....
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.46584 seconds with 12 queries