Jump to content

<Help> - Table after PHP code - </Help>


Monshery

Recommended Posts

i am tring to load data to a table after i load it from mysql:

Code:
[code]
<?php
if (($_POST['SAGE'] != 0) && ($_POST['EAGE'] != 0))
if(isset($_POST['GAMEP']))
{
$MMO_LINK=mysql_connect('localhost','Monshery','m7625zsw') or die("Connection fail");
mysql_select_db('mmodate',$MMO_LINK);
$MMO_USERD = mysql_query("SELECT MYNAME,MYLASTNAME,GENDER,GENDERWANT,COUNTRY,CITY,GAMEP,PIC,ABOUTME,ABOUTYOU,AGE FROM USERDETAIL WHERE GENDER = '$_POST[GENDER]' && GAMEP = '$_POST[GAMEP]' && GENDERWANT = '$_POST[GENDERWANT]' && COUNTRY = '$_POST[COUNTRY]' && AGE >= '$_POST[SAGE]' && AGE <= '$_POST[EAGE]'",$MMO_LINK);
$MMO_PRINGD = mysql_fetch_array($MMO_USERD);
if(isset($MMO_PRINGD['GAMEP']))
?>

<html>
<body>
<table width="457" height="120" border="1">
            <tr>
              <td height="82"><table width="489" height="117" border="1">
                <tr>
                  <td><img src="Pics/Eve-Online/Login_r1_c1.jpg" width="154" height="113"></td>
                  <td>About me:<? echo $MMO_PRINGD['ABOUTME'];?></td>
                  <td>About her:<? echo $MMO_PRINGD['ABOUTYOU'];?></td>
                </tr>
              </table></td>
            </tr>
            <tr>
              <td height="30"><table width="495" border="1">
                <tr>
                  <td>my name: <? echo $MMO_PRINGD['MYNAME'];?></td>
                  <td>Last name: <? echo $MMO_PRINGD['MYLASTNAME']; ?></td>
                  <td>age: <? echo $MMO_PRINGD['AGE']; ?></td>
                  <td>country:<? echo $MMO_PRINGD['COUNTRY'];?></td>
                  <td>city:<? echo $MMO_PRINGD['CITY'];?></td>
                  <td>Game i play:<? echo $MMO_PRINGD['GAMEP'];?></td>
                  <td>i am a:echo <? $MMO_PRINGD['GENDER'];?></td>
                </tr>
              </table></td>
            </tr>
          </table>
          </BODY>
          </HTML>
<?
echo $MMO_PRINGD['MYNAME']. $MMO_PRINGD['MYLASTNAME']. $MMO_PRINGD['GENDER']. $MMO_PRINGD['GENDERWANT']. $MMO_PRINGD['COUNTRY']. $MMO_PRINGD['CITY'] .$MMO_PRINGD['GAMEP'] .$MMO_PRINGD['PIC'] .$MMO_PRINGD['ABOUTME'] .$MMO_PRINGD['ABOUTYOU'] .$MMO_PRINGD['AGE'];
}
else echo "You must fill in the details";
else echo "You must choose a age";
?>
[/code]


I get this error after i try to run it .
Parse error: syntax error, unexpected $end in C:\wamp\www\Yanivs\MMO-Date\FOUND.PHP on line 482

Thanks in advanced and sorry for the long text - any help will be appriciated.
Link to comment
https://forums.phpfreaks.com/topic/12807-table-after-php-code/
Share on other sites

But everything after this code is a HTML - how comes i need to use ; on HTML code ?

this is exacly whats comes after that code.

[code]
          <td width="145">&nbsp;</td>
        </tr>
        <tr>
          <td height="18" colspan="3">&nbsp;</td>
        </tr>
      </table>
      <p><FONT face="Verdana, Arial, Helvetica, sans-serif">©2006MMO-Date Webmaster and web-creator, All rights reserved
          for comments<A href="mailto:[email protected]">(click
          )</A></FONT></p>
    </DIV></TD>
  </TR></TBODY>
</TABLE>
</BODY></HTML>

[/code]
Link to comment
https://forums.phpfreaks.com/topic/12807-table-after-php-code/#findComment-49076
Share on other sites

[code]if(isset($MMO_PRINGD['GAMEP']))[/code]

Hmm.. I'm not really sure about your code, but I think you short of [b]{[/b]
[code]if(isset($MMO_PRINGD['GAMEP'])) {[/code]

And I think there's some problem with

[code]else echo "You must fill in the details";
else echo "You must choose a age";[/code]

Maybe it should be

[code]else {
echo "You must fill in the details";
echo "You must choose a age";
}[/code]
Link to comment
https://forums.phpfreaks.com/topic/12807-table-after-php-code/#findComment-49077
Share on other sites



You missed a echo statement ok.

corrected code
[code]
<html>
<body>
<table width="457" height="120" border="1">
            <tr>
              <td height="82"><table width="489" height="117" border="1">
                <tr>
                  <td><img src="Pics/Eve-Online/Login_r1_c1.jpg" width="154" height="113"></td>
                  <td>About me:<? echo $MMO_PRINGD['ABOUTME'];?></td>
                  <td>About her:<? echo $MMO_PRINGD['ABOUTYOU'];?></td>
                </tr>
              </table></td>
            </tr>
            <tr>
              <td height="30"><table width="495" border="1">
                <tr>
                  <td>my name: <? echo $MMO_PRINGD['MYNAME'];?></td>
                  <td>Last name: <? echo $MMO_PRINGD['MYLASTNAME']; ?></td>
                  <td>age: <? echo $MMO_PRINGD['AGE']; ?></td>
                  <td>country:<? echo $MMO_PRINGD['COUNTRY'];?></td>
                  <td>city:<? echo $MMO_PRINGD['CITY'];?></td>
                  <td>Game i play:<? echo $MMO_PRINGD['GAMEP'];?></td>
                  <td>i am a:<? echo $MMO_PRINGD['GENDER'];?></td>
                </tr>
              </table></td>
            </tr>
          </table>
          </BODY>
          </HTML>
[/code]
Link to comment
https://forums.phpfreaks.com/topic/12807-table-after-php-code/#findComment-49078
Share on other sites

Look:

[code]
if (($_POST['SAGE'] != 0) && ($_POST['EAGE'] != 0)) /* if this works it will go to next if*/
if(isset($_POST['GAMEP']))/* if this next if works it will execute the whole code */
{ /* i have this '{' mark as you see and its close after the second part of the php code open */
[/code]

Second code
[code]
<?
echo $MMO_PRINGD['MYNAME']. $MMO_PRINGD['MYLASTNAME']. $MMO_PRINGD['GENDER']. $MMO_PRINGD['GENDERWANT']. $MMO_PRINGD['COUNTRY']. $MMO_PRINGD['CITY'] .$MMO_PRINGD['GAMEP'] .$MMO_PRINGD['PIC'] .$MMO_PRINGD['ABOUTME'] .$MMO_PRINGD['ABOUTYOU'] .$MMO_PRINGD['AGE'];/* all this is just a check for my self to see if i actualy pulling date from SQL without a problem and - no problem (without the table) */
} /* this mark end the block as before */
else echo "You must fill in the details";/* this one will run if first if wont work.*/
else echo "You must choose a age";/* this will work if second if wont work.*/
?>
[/code]
Link to comment
https://forums.phpfreaks.com/topic/12807-table-after-php-code/#findComment-49080
Share on other sites

<?php
if (($_POST['SAGE'] != 0) && ($_POST['EAGE'] != 0)) {

if(isset($_POST['GAMEP'])) {


$MMO_LINK=mysql_connect('localhost','Monshery','m7625zsw') or die("Connection fail");
mysql_select_db('mmodate',$MMO_LINK);
$MMO_USERD = mysql_query("SELECT MYNAME,MYLASTNAME,GENDER,GENDERWANT,COUNTRY,CITY,GAMEP,PIC,ABOUTME,ABOUTYOU,AGE FROM USERDETAIL WHERE GENDER = '$_POST[GENDER]' && GAMEP = '$_POST[GAMEP]' && GENDERWANT = '$_POST[GENDERWANT]' && COUNTRY = '$_POST[COUNTRY]' && AGE >= '$_POST[SAGE]' && AGE <= '$_POST[EAGE]'",$MMO_LINK);
$MMO_PRINGD = mysql_fetch_array($MMO_USERD);
if(isset($MMO_PRINGD['GAMEP']))

?>

<html>
<body>
<table width="457" height="120" border="1">
<tr>
<td height="82"><table width="489" height="117" border="1">
<tr>
<td><img src="Pics/Eve-Online/Login_r1_c1.jpg" width="154" height="113"></td>
<td>About me:<? echo $MMO_PRINGD['ABOUTME'];?></td>
<td>About her:<? echo $MMO_PRINGD['ABOUTYOU'];?></td>
</tr>
</table></td>
</tr>
<tr>
<td height="30"><table width="495" border="1">
<tr>
<td>my name: <? echo $MMO_PRINGD['MYNAME'];?></td>
<td>Last name: <? echo $MMO_PRINGD['MYLASTNAME']; ?></td>
<td>age: <? echo $MMO_PRINGD['AGE']; ?></td>
<td>country:<? echo $MMO_PRINGD['COUNTRY'];?></td>
<td>city:<? echo $MMO_PRINGD['CITY'];?></td>
<td>Game i play:<? echo $MMO_PRINGD['GAMEP'];?></td>
<td>i am a:<?echo $MMO_PRINGD['GENDER'];?></td>
</tr>
</table></td>
</tr>
</table>
</BODY>
</HTML>
<?
echo $MMO_PRINGD['MYNAME']. $MMO_PRINGD['MYLASTNAME']. $MMO_PRINGD['GENDER']. $MMO_PRINGD['GENDERWANT']. $MMO_PRINGD['COUNTRY']. $MMO_PRINGD['CITY'] .$MMO_PRINGD['GAMEP'] .$MMO_PRINGD['PIC'] .$MMO_PRINGD['ABOUTME'] .$MMO_PRINGD['ABOUTYOU'] .$MMO_PRINGD['AGE'];

}

}else{
if($AGE=="none") {
echo "You must choose an age";

}

?>
Link to comment
https://forums.phpfreaks.com/topic/12807-table-after-php-code/#findComment-49083
Share on other sites

Same error - just tried you added {/} the problem wasnt with those marks its was something else.

If i completly remove the table - everything works the second i add the table its all screw up . E.G:

[code]
<?php
if (($_POST['SAGE'] != 0) && ($_POST['EAGE'] != 0))
if(isset($_POST['GAMEP']))
{
$MMO_LINK=mysql_connect('localhost','Monshery','m7625zsw') or die("Connection fail");
mysql_select_db('mmodate',$MMO_LINK);
$MMO_USERD = mysql_query("SELECT MYNAME,MYLASTNAME,GENDER,GENDERWANT,COUNTRY,CITY,GAMEP,PIC,ABOUTME,ABOUTYOU,AGE FROM USERDETAIL WHERE GENDER = '$_POST[GENDER]' && GAMEP = '$_POST[GAMEP]' && GENDERWANT = '$_POST[GENDERWANT]' && COUNTRY = '$_POST[COUNTRY]' && AGE >= '$_POST[SAGE]' && AGE <= '$_POST[EAGE]'",$MMO_LINK);
$MMO_PRINGD = mysql_fetch_array($MMO_USERD);
if(isset($MMO_PRINGD['GAMEP']))

echo $MMO_PRINGD['MYNAME']. $MMO_PRINGD['MYLASTNAME']. $MMO_PRINGD['GENDER']. $MMO_PRINGD['GENDERWANT']. $MMO_PRINGD['COUNTRY']. $MMO_PRINGD['CITY'] .$MMO_PRINGD['GAMEP'] .$MMO_PRINGD['PIC'] .$MMO_PRINGD['ABOUTME'] .$MMO_PRINGD['ABOUTYOU'] .$MMO_PRINGD['AGE'];
}
else echo "You must fill in the details";
else echo "You must choose a age";
?>
[/code]

This code work just fine - it echoing all the variable i asked.


But when i try to echo the variable into table it gives me this error.
this is code when i try to echo into table:

[code]
   <?php
if (($_POST['SAGE'] != 0) && ($_POST['EAGE'] != 0))
if(isset($_POST['GAMEP']))
{
$MMO_LINK=mysql_connect('localhost','Monshery','m7625zsw') or die("Connection fail");
mysql_select_db('mmodate',$MMO_LINK);
$MMO_USERD = mysql_query("SELECT MYNAME,MYLASTNAME,GENDER,GENDERWANT,COUNTRY,CITY,GAMEP,PIC,ABOUTME,ABOUTYOU,AGE FROM USERDETAIL WHERE GENDER = '$_POST[GENDER]' && GAMEP = '$_POST[GAMEP]' && GENDERWANT = '$_POST[GENDERWANT]' && COUNTRY = '$_POST[COUNTRY]' && AGE >= '$_POST[SAGE]' && AGE <= '$_POST[EAGE]'",$MMO_LINK);
$MMO_PRINGD = mysql_fetch_array($MMO_USERD);
if(isset($MMO_PRINGD['GAMEP']))
?>
<html>
<body>
<table width="457" height="120" border="1">
            <tr>
              <td height="82"><table width="489" height="117" border="1">
                <tr>
                  <td><img src="Pics/Eve-Online/Login_r1_c1.jpg" width="154" height="113"></td>
                  <td>About me:<? echo $MMO_PRINGD['ABOUTME'];?></td>
                  <td>About her:<? echo $MMO_PRINGD['ABOUTYOU'];?></td>
                </tr>
              </table></td>
            </tr>
            <tr>
              <td height="30"><table width="495" border="1">
                <tr>
                  <td height="60">my name: <? echo $MMO_PRINGD['MYNAME'];?></td>
                  <td>Last name: <? echo $MMO_PRINGD['MYLASTNAME']; ?></td>
                  <td>age: <? echo $MMO_PRINGD['AGE']; ?></td>
                  <td>country:<? echo $MMO_PRINGD['COUNTRY'];?></td>
                  <td>city:<? echo $MMO_PRINGD['CITY'];?></td>
                  <td>Game i play:<? echo $MMO_PRINGD['GAMEP'];?></td>
                  <td>i am a:echo <? $MMO_PRINGD['GENDER'];?></td>
                </tr>
              </table></td>
            </tr>
          </table>
          </BODY>
          </HTML>
<?
echo $MMO_PRINGD['MYNAME']. $MMO_PRINGD['MYLASTNAME']. $MMO_PRINGD['GENDER']. $MMO_PRINGD['GENDERWANT']. $MMO_PRINGD['COUNTRY']. $MMO_PRINGD['CITY'] .$MMO_PRINGD['GAMEP'] .$MMO_PRINGD['PIC'] .$MMO_PRINGD['ABOUTME'] .$MMO_PRINGD['ABOUTYOU'] .$MMO_PRINGD['AGE'];
}
else echo "You must fill in the details";
else echo "You must choose a age";
?>
[/code]

thanks. for your help.
Link to comment
https://forums.phpfreaks.com/topic/12807-table-after-php-code/#findComment-49087
Share on other sites

[!--sizeo:5--][span style=\"font-size:18pt;line-height:100%\"][!--/sizeo--]try this way ok fully tested ok.[!--sizec--][/span][!--/sizec--]


[code]
<?php

$MMO_LINK=mysql_connect('localhost','Monshery','m7625zsw') or die("Connection fail");

mysql_select_db('mmodate',$MMO_LINK);

$MMO_USERD = "select * FROM USERDETAIL WHERE GENDER = '$GENDER' && GAMEP = '$GAMEP' && GENDERWANT = '$GENDERWANT' && COUNTRY = '$COUNTRY' && AGE >= '$SAGE' && AGE <= '$EAGE' ";

$result=mysql_query($MMO_USERD);

while($MMO_PRINGD=mysql_fetch_assoc($result)) {

?>

<html>
<body>
<table width="457" height="120" border="1">
<tr>
<td height="82"><table width="489" height="117" border="1">
<tr>
<td><img src="Pics/Eve-Online/Login_r1_c1.jpg" width="154" height="113"></td>
<td>About me:<? echo $MMO_PRINGD['ABOUTME'];?></td>
<td>About her:<? echo $MMO_PRINGD['ABOUTYOU'];?></td>
</tr>
</table></td>
</tr>
<tr>
<td height="30"><table width="495" border="1">
<tr>
<td>my name: <? echo $MMO_PRINGD['MYNAME'];?></td>
<td>Last name: <? echo $MMO_PRINGD['MYLASTNAME']; ?></td>
<td>age: <? echo $MMO_PRINGD['AGE']; ?></td>
<td>country:<? echo $MMO_PRINGD['COUNTRY'];?></td>
<td>city:<? echo $MMO_PRINGD['CITY'];?></td>
<td>Game i play:<? echo $MMO_PRINGD['GAMEP'];?></td>
<td>i am a:<?echo $MMO_PRINGD['GENDER'];?></td>
</tr>
</table></td>
</tr>
</table>
</BODY>
</HTML>

<?}}?>


[/code]

[!--sizeo:5--][span style=\"font-size:18pt;line-height:100%\"][!--/sizeo--]this will show all data in the database ok.[!--sizec--][/span][!--/sizec--]
Link to comment
https://forums.phpfreaks.com/topic/12807-table-after-php-code/#findComment-49093
Share on other sites

How can this be wrong and not show the data lol


[code]
<?php


$MMO_LINK=mysql_connect('localhost','Monshery','m7625zsw') or die("Connection fail");

mysql_select_db("mmodate",$MMO_LINK);

$MMO_USERD = "select * FROM USERDETAIL WHERE GENDER = '$GENDER' && GAMEP = '$GAMEP' && GENDERWANT = '$GENDERWANT' && COUNTRY = '$COUNTRY' && AGE >= '$SAGE' && AGE <= '$EAGE' ";

$result=mysql_query($MMO_USERD);

while($MMO_PRINGD=mysql_fetch_assoc($result)) {

?>

<html>
<body>
<table width="457" height="120" border="1">
<tr>
<td height="82"><table width="489" height="117" border="1">
<tr>
<td><img src="Pics/Eve-Online/Login_r1_c1.jpg" width="154" height="113"></td>
<td>About me:<? echo $MMO_PRINGD['ABOUTME'];?></td>
<td>About her:<? echo $MMO_PRINGD['ABOUTYOU'];?></td>
</tr>
</table></td>
</tr>
<tr>
<td height="30"><table width="495" border="1">
<tr>
<td>my name: <? echo $MMO_PRINGD['MYNAME'];?></td>
<td>Last name: <? echo $MMO_PRINGD['MYLASTNAME']; ?></td>
<td>age: <? echo $MMO_PRINGD['AGE']; ?></td>
<td>country:<? echo $MMO_PRINGD['COUNTRY'];?></td>
<td>city:<? echo $MMO_PRINGD['CITY'];?></td>
<td>Game i play:<? echo $MMO_PRINGD['GAMEP'];?></td>
<td>i am a:<?echo $MMO_PRINGD['GENDER'];?></td>
</tr>
</table></td>
</tr>
</table>
</BODY>
</HTML>

<?}?>


[/code]

Link to comment
https://forums.phpfreaks.com/topic/12807-table-after-php-code/#findComment-49115
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.