kendallkamikaze Posted March 12, 2009 Author Share Posted March 12, 2009 try[if (!mysql_query($sql)) { echo $sql,'<br />'; echo mysql_error(),'<br />'; die('You have already submitted a request to this association from this horse');} and post the error i dont think its that...i think it still has to do with the original code; because if you look horseid = $id and $id is also the id of the owner...i think its because theres two $id Quote Link to comment https://forums.phpfreaks.com/topic/149163-cant-combined-two-mysql-tables/page/2/#findComment-783361 Share on other sites More sharing options...
redarrow Posted March 12, 2009 Share Posted March 12, 2009 name = the submit button submit <?php include 'header.php'; if(isset($_POST['submit'])){ $sql="INSERT INTO assorequest (horseid, assoid, ownerid) VALUES ('{$_POST['horseid']}','{$_POST['assoid']}','{$_POST['id']}')"; } if (!mysql_query($sql)) { die('You have already submitted a request to this association from this horse'); include 'footer.php'; exit;} echo "<BR><BR><font size='5pt' face='comic sans ms'><B>Registration Request Submitted</b></font><BR><BR>"; ?> <?php include 'footer.php'; ?> Quote Link to comment https://forums.phpfreaks.com/topic/149163-cant-combined-two-mysql-tables/page/2/#findComment-783365 Share on other sites More sharing options...
kendallkamikaze Posted March 12, 2009 Author Share Posted March 12, 2009 name = the submit button submit <?php include 'header.php'; if(isset($_POST['submit'])){ $sql="INSERT INTO assorequest (horseid, assoid, ownerid) VALUES ('{$_POST['horseid']}','{$_POST['assoid']}','{$_POST['id']'}"; } if (!mysql_query($sql)) { die('You have already submitted a request to this association from this horse'); include 'footer.php'; exit;} echo "<BR><BR><font size='5pt' face='comic sans ms'><B>Registration Request Submitted</b></font><BR><BR>"; ?> <?php include 'footer.php'; ?> "Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting '}' in /home/collegh9/public_html/one-stride/association_apply.php on line 15" I really believe that it has to do with the other code and not this one. Quote Link to comment https://forums.phpfreaks.com/topic/149163-cant-combined-two-mysql-tables/page/2/#findComment-783366 Share on other sites More sharing options...
redarrow Posted March 12, 2009 Share Posted March 12, 2009 <?php include 'header.php'; if(isset($_POST['submit'])){ $sql="INSERT INTO assorequest (horseid, assoid, ownerid) VALUES ('{$_POST['horseid']}','{$_POST['assoid']}','{$_POST['id']}')"; } if (!mysql_query($sql)) { die('You have already submitted a request to this association from this horse'); include 'footer.php'; exit;} echo "<BR><BR><font size='5pt' face='comic sans ms'><B>Registration Request Submitted</b></font><BR><BR>"; ?> <?php include 'footer.php'; ?> Quote Link to comment https://forums.phpfreaks.com/topic/149163-cant-combined-two-mysql-tables/page/2/#findComment-783368 Share on other sites More sharing options...
kendallkamikaze Posted March 13, 2009 Author Share Posted March 13, 2009 didnt work. it is not inserting the horse ID at all and i dont know why Quote Link to comment https://forums.phpfreaks.com/topic/149163-cant-combined-two-mysql-tables/page/2/#findComment-783429 Share on other sites More sharing options...
kendallkamikaze Posted March 13, 2009 Author Share Posted March 13, 2009 This portion of the code is making it so when you register it doesnt put the horse ID into the mysql table...everything but the horsesid gets inserted <?php $assoname=$_GET['assoname']; $assoid=$_GET['assoid']; $sql="SELECT * FROM horsedata LEFT JOIN registration ON registration.horseid = horsedata.id WHERE Owner='$id' AND ISNULL(registration.assoname) GROUP BY horsedata.id"; $result=mysql_query($sql)or die(mysql_error()); while($r=mysql_fetch_array($result)) { $horseid=$r["id"]; $name=$r["Name"]; $assoid=$_GET['id']; echo "<center> <form action='association_apply.php' method='post'> <input type='hidden' value='$horseid' name='horseid'> <input type='hidden' value='$assoid' name='assoid'> <input type='submit' value='$name'></form> </center> "; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/149163-cant-combined-two-mysql-tables/page/2/#findComment-783430 Share on other sites More sharing options...
kendallkamikaze Posted March 13, 2009 Author Share Posted March 13, 2009 anyone ? Quote Link to comment https://forums.phpfreaks.com/topic/149163-cant-combined-two-mysql-tables/page/2/#findComment-783463 Share on other sites More sharing options...
kendallkamikaze Posted March 13, 2009 Author Share Posted March 13, 2009 any fresh minds ??? Quote Link to comment https://forums.phpfreaks.com/topic/149163-cant-combined-two-mysql-tables/page/2/#findComment-783549 Share on other sites More sharing options...
kendallkamikaze Posted March 13, 2009 Author Share Posted March 13, 2009 I've worked on this for another 2 hours today Quote Link to comment https://forums.phpfreaks.com/topic/149163-cant-combined-two-mysql-tables/page/2/#findComment-784116 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.