Unknown column 'Garcia' in 'where clause' -------> Garcia is the surname of the player
I have not idea what does clause means. I know that I never used such a name.
This feuture uses 2 php pages. The first one opens the popup.
<script type="text/javascript"> <!-- var stile = "top=50, left=50, width=600, height=200 status=no, menubar=no, toolbar=no scrollbar=no"; function Popup(apri) { window.open(apri, "", stile); } //--> </script><a href="javascript:Popup('attpopup.php?UID=<?=$UID?>&Enme=<?php echo $row['Name']?>&ATS=<?php echo $row['att']?>&Skill=<?php $Skill='Att'?><?=$Skill?>')"><img src="Add-icon.png" width="16" height="16" />The second one IS the pop-up page:
<?php session_start(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[url="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd[/url]"> <html xmlns="[url="http://www.w3.org/1999/xhtml"]http://www.w3.org/1999/xhtml[/url]"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <SCRIPT language="Javascript"> function buttonYes() { <?php if (isset($_POST['Submit1'])) { $PlayerID = $_SESSION['myusername']; $UID = $_SESSION['UID']; mysql_connect("localhost", "root", "") or die(mysql_error()); mysql_select_db("lightleague") or die(mysql_error()); $result = mysql_query("Update players set att='$att' where UID=$UID & Ename=$Enme" ) or die(mysql_error()); $row1 = mysql_fetch_array($result); } ?> } </SCRIPT> </head> <body> <?php $UID = $_SESSION['UID']; $att = $_GET['ATS']; $Enme = $_GET['Enme']; //$Skill = $_GET['ATS=/!!l']; $att = $att+1; //$Money = if (isset($_POST['update'])) { /*$PlayerID = $_SESSION['myusername']; $UID = $_SESSION['UID'];*/ mysql_connect("localhost", "root", "") or die(mysql_error()); mysql_select_db("lightleague") or die(mysql_error()); $result1 = mysql_query("select * from uplayer where UID='$UID'" ); $row1 = mysql_fetch_array($result1); //$Money = $row1['Money']; if ($row1['Money']>49) { mysql_query("Update players set att='$att' where UID=$UID & Ename=$Enme" ) or die(mysql_error()); $result2 = mysql_query("select * from uplayer where UID='$UID'" ); $row2 = mysql_fetch_array($result2); $CMoney = $row2['Money'] - 50; mysql_query("Update uplayer set Money='$CMoney' where UID=$UID" ) or die(mysql_error()); echo "Succesful Update"; } else //If ($row1['Money'])>99 { echo "Not enough money"; } } else {?> <p>Do you want to spend 50$ to increase this skill?</p> <table width="200" border="1"> <tr> <td width="64"><form id="form1" name="form1" method="post" action="attpopup.php?UID=<?=$UID?>&Enme=<?php echo $Enme?>&att=<?=$att?><?php $Skill='att'?><?=$Skill?>&ATS=<?php echo $att?>"> <p> <input type="submit" name="button" id="button" value="Yes" /> <input type="hidden" name="update" value="yes" id="hiddenField" /> </p> </form></td> <td width="89"><form id="form2" name="form2" method="post" action=""> <input type="submit" name="button2" id="button2" value="No" /> </form></td> <td width="25"> </td> </tr> </table> <?php } ?> </body> </html>