Warning: mysql_result(): Unable to jump to row 1 on MySQL result index 3 in /home/frent/domains/frent.be/public_html/poll/vote.php on line 28
Warning: mysql_result(): Unable to jump to row 1 on MySQL result index 3 in /home/frent/domains/frent.be/public_html/poll/vote.php on line 29
Warning: mysql_result(): Unable to jump to row 1 on MySQL result index 3 in /home/frent/domains/frent.be/public_html/poll/vote.php on line 30
Warning: mysql_result(): Unable to jump to row 1 on MySQL result index 3 in /home/frent/domains/frent.be/public_html/poll/vote.php on line 31
&totalVotes=0&vote1total=&vote2total=&vote3total=&vote4total=
<?
//User, password & database
$choice =$_POST['choice'];
$user="frent_frent";
$password="***";
$database="frent_poll";
mysql_connect(localhost,$user,$password);
@mysql_select_db($database) or die( "Unable to connect to database");
// what choice did the user choose in flash?
if($choice == 1){
$query="UPDATE votesystem SET vote1=vote1+1";
}
if($choice == 2){
$query="UPDATE votesystem SET vote2=vote2+1";
}
if($choice == 3){
$query="UPDATE votesystem SET vote3=vote3+1";
}
if($choice == 4){
$query="UPDATE votesystem SET vote4=vote4+1";
}
mysql_query($query);
//Get values from the database
$query="SELECT * FROM votesystem";
$result=mysql_query($query);
mysql_close();
//What are the values from the database?
$vote1_out=mysql_result($result,0,"vote1");
$vote2_out=mysql_result($result,0,"vote2");
$vote3_out=mysql_result($result,0,"vote3");
$vote4_out=mysql_result($result,0,"vote4");
//Votes in total
$total=$vote1_out+$vote2_out+$vote3_out+$vote4_out;
//Info to send back to flash:
$values="&totalVotes=$total&vote1total=$vote1_out&vote2total=$vote2_out&vote3total=$vote3_out&vote4total=$vote4_out";
echo $values;
?>
<?PHP
$sQuery = "je query";
if(!$rResult = MySQL_Query($sQuery))
{
echo "Error!- Kan de query niet uitvoeren!<br />";
echo MySQL_Error()."<br />".MySQL_Errno();
} else
{
// succesvol uitgevoerd
// hier de rest van je code
}
?>
<?
$user="frent_frent";
$password="***";
$database="frent_poll";
mysql_connect(localhost,$user,$password);
@mysql_select_db($database) or die("Unable to select database");
$query="CREATE TABLE votesystem (vote1 int(4) NOT NULL,vote2 int(4) NOT NULL,vote3 int(4) NOT NULL,vote4 int(4) NOT NULL)";
mysql_query($query);
mysql_close();
?>
if(!$result = mysql_query($query))
{
echo "Error!- Kan de query niet uitvoeren!<br />";
echo MySQL_Error()."<br />".MySQL_Errno();
} else
{
//What are the values from the database?
$vote1_out=mysql_result($result,0,"vote1");
$vote2_out=mysql_result($result,0,"vote2");
$vote3_out=mysql_result($result,0,"vote3");
$vote4_out=mysql_result($result,0,"vote4");
//Votes in total
$total=$vote1_out+$vote2_out+$vote3_out+$vote4_out;
//Info to send back to flash:
$values="&totalVotes=$total&vote1total=$vote1_out&vote2total=$vote2_out&vote3total=$vote3_out&vote4total=$vote4_out";
echo $values;
}
Warning: mysql_query(): Access denied for user: 'apache@localhost' (Using password: NO) in /home/frent/domains/frent.be/public_html/poll/vote.php on line 28
Warning: mysql_query(): A link to the server could not be established in /home/frent/domains/frent.be/public_html/poll/vote.php on line 28
Error!- Kan de query niet uitvoeren!
Access denied for user: 'apache@localhost' (Using password: NO)
1045&totalVotes=0&vote1total=&vote2total=&vote3total=&vote4total=
Warning: mysql_query(): Access denied for user: 'apache@localhost' (Using password: NO) in /home/frent/domains/frent.be/public_html/poll/vote.php on line 28
Wat dacht je van een goede verbinding met je MySQL server?
Warning: mysql_query(): Access denied for user: 'apache@localhost' (Using password: NO) in /home/frent/domains/frent.be/public_html/poll/vote.php on line 28
Warning: mysql_query(): A link to the server could not be established in /home/frent/domains/frent.be/public_html/poll/vote.php on line 28
Error!- Kan de query niet uitvoeren!
Access denied for user: 'apache@localhost' (Using password: NO)
1045&totalVotes=0&vote1total=&vote2total=&vote3total=&vote4total=
euhm eerste keer dat ik MySql database maak, dus ik hoop van harte dat het daar niet aan ligt.
er staat wel altijd frent_frent en frent_poll dit is omda dat automatisch zo is , ik hoop toch niet dat mijn username dan gewoon frent is ( wat ik invul ) en de database poll is ( wat ik ook invul ) want frent_ staat er automatisch en kan ik niet veranderen
Dan kom je achter de vaud in het connecten van je DB
en je hebt een @ als je je DB_naam gaat selecteren haal die eens weg want je hebt daar een or die(); achterstaan
ps. Ben nog PHP-noob maar heb zoiets gelezen dat als je @ voor je mysql_select_db doet dat je dan geen or die() hoeft te gebruiken omdat hij dan zelf al de vaudmelding geeft