Jump to content


Photo

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


  • Please log in to reply
13 replies to this topic

#1 Monshery

Monshery
  • Members
  • PipPipPip
  • Advanced Member
  • 44 posts

Posted 24 June 2006 - 03:12 PM

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

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";
?>


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.


#2 hackerkts

hackerkts
  • Members
  • PipPipPip
  • Advanced Member
  • 593 posts
  • LocationSingapore
  • Age:18

Posted 24 June 2006 - 03:14 PM

Hmm.. What's few lines before line 482 and after.
I think you short of ;

Regards,
hackerkts

To be a coder, you must learn how to think and not to give up so easily.


#3 Monshery

Monshery
  • Members
  • PipPipPip
  • Advanced Member
  • 44 posts

Posted 24 June 2006 - 03:19 PM

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.

          <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:enigman1@012.net.il">(click 
          )</A></FONT></p>
    </DIV></TD>
  </TR></TBODY>
</TABLE>
</BODY></HTML>



#4 hackerkts

hackerkts
  • Members
  • PipPipPip
  • Advanced Member
  • 593 posts
  • LocationSingapore
  • Age:18

Posted 24 June 2006 - 03:24 PM

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

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

And I think there's some problem with

else echo "You must fill in the details";
else echo "You must choose a age";

Maybe it should be

else {
echo "You must fill in the details";
echo "You must choose a age";
}


Regards,
hackerkts

To be a coder, you must learn how to think and not to give up so easily.


#5 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 24 June 2006 - 03:29 PM



You missed a echo statement ok.

corrected 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>

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#6 Monshery

Monshery
  • Members
  • PipPipPip
  • Advanced Member
  • 44 posts

Posted 24 June 2006 - 03:31 PM

Look:

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 */

Second 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.*/
?>


#7 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 24 June 2006 - 03:39 PM

<?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";

}

?>

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#8 Monshery

Monshery
  • Members
  • PipPipPip
  • Advanced Member
  • 44 posts

Posted 24 June 2006 - 03:51 PM

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:

<?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";
?>

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:

   <?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";
?>

thanks. for your help.

#9 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 24 June 2006 - 03:55 PM

Your select statement is wrong, why use post with only viewing ok.


$query="select * from xxxx where xxxxx ='xxxxxx' ";
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#10 Monshery

Monshery
  • Members
  • PipPipPip
  • Advanced Member
  • 44 posts

Posted 24 June 2006 - 03:58 PM

you mean to change it to get ?


#11 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 24 June 2006 - 04:02 PM

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


<?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>

<?}}?>



[!--sizeo:5--][span style=\"font-size:18pt;line-height:100%\"][!--/sizeo--]this will show all data in the database ok.[!--sizec--][/span][!--/sizec--]
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#12 Monshery

Monshery
  • Members
  • PipPipPip
  • Advanced Member
  • 44 posts

Posted 24 June 2006 - 04:22 PM

Same error mate but thanks for tring to help i will just try to learn the whole PHP 5 book i have before trying to make something.

Thnx all for tring to help me.

#13 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 24 June 2006 - 04:46 PM

How can this be wrong and not show the data lol


<?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>

<?}?>




Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc

#14 Monshery

Monshery
  • Members
  • PipPipPip
  • Advanced Member
  • 44 posts

Posted 24 June 2006 - 06:19 PM

i'm combining between dreamweever and php i just typed in the script window the php code and i get this error so i dont know what to tell you but i will read some more and i will succeed




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users