I Can't find the problem. The code:
mysql_query("insert into games(week, fight, league_id)values($_REQUEST['week'],'$_REQUEST[home_team]-$_REQUEST[guest_team]',$_REQUEST['home_league'])", $Link);
The error message:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING
what am i doing wrong? I can't see it... I want to catch the rand variable but it doesn't. So I print an extra print at the bottom. So there should be two rand prints. Here's the code.
<html>
<head><title></title>
</head>
<body>
<form action='random.php' method='post'>
<?php
if(isset($_REQUEST['rand'])){
$rand = $_REQUEST['rand'];
print $rand . "<br /><br />";
} else {
print "rand: empty<br /><br />";
}
$rand = rand(1,1000);
print $rand."<br /><br />";
print "<input type='hidden' value='$rand' />";
?>
<input type='submit' value='scramble' />
</form>
</body>
</html>
I forgot to tell ya that the if statement returns rand: empty. Help...
for($i=1; $i<=$round; $i++){
print "<tr><td align='left' valign='top'><input type='text' name='number$i' maxlength='2' size='2' /></td>\n ";
print "<td align='left' valign='top'><input type='text' name='score$i' maxlength='1' size='1' /></td>\n ";
print "<td align='left' valign='top'><select name='team$i'>\n";
print "<option value='-'>-<option>\n";
print "<option value='Home'>Home<option>\n";
print "<option value='Away'>Away<option>\n";
print "</select></td></tr>";
}
What I'm having trouble with is that for every option tag there is an empty option tag added. How do I get rid of those empty option tags? Thankful for any help.
I'm trying to create a trigger that checks intries in a table.
CREATE TRIGGER check_stored_stars BEFORE INSERT ON stored_stars
FOR EACH ROW
BEGIN
IF NEW.user_id = OLD.user_id AND NEW.star_id = OLD.star_id
ELSE
INSERT INTO stored_stars(user_id, star_id)
VALUES(NEW.user_id, NEW.star_id);
END IF;
END;
But I get an error saying: #1363 - There is no OLD row in on INSERT trigger
How do I solve this?
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.