Php vraag

Gestart doorBraam11 reacties33 weergaven

12 berichten · pagina 1 van 1

Braam

Lid · Topicstarter

Berichten
6.867
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Heb ik net me vorige topic laten sluiten, stuit ik op het volgende probleem

Error: Column count doesnt match value count at row 1
Spoiler tonen
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]mysql.php[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]Registrar[/COLOR][COLOR= #007700]])){[/COLOR]
    [COLOR= #0000BB]$data[/COLOR][COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"INSERT INTO Domein (Registrar, Naam, Extensie, Verloopdatum, id) VALUES ("[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]Registrar[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]","[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]Naam[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]","[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]Extensie[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]","[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]Verloopdatum[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]","[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]Whois[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]","[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]")"[/COLOR][COLOR= #007700];[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$data[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$mysql[/COLOR][COLOR= #007700])) {[/COLOR]
        [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]Error: [/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());
    }[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Domein toegevoegd"[/COLOR][COLOR= #007700];[/COLOR]
    [URL="http://www.php.net/mysql_close"]mysql_close[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$mysql[/COLOR][COLOR= #007700]);
}[/COLOR]
?>

<html>
<body>
<form action="index.php" method="post">
Registrar: <input type="text" name="Registrar" />
Naam: <input type="text" name="Naam" />
Extensie: <input type="text" name="Extensie" />
Verloopdatum: <input type="text" name="Verloopdatum" />
Whois: <input type="text" name="Whois" />
id: <input type="text" name="id" /><br />
<input type="submit" name="verstuur" />
</form>
</body>
</html>
Wat doe ik nu fout .. aah
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Je geeft 5 keys aan om te inserten, maar je insert 6 values.
0
Fass

Lid

Berichten
3.771
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
NOU dat wilde ik zeggen. Je bent whois vergeten. biggrin
0
Berichten
3.074
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]mysql.php[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]Registrar[/COLOR][COLOR= #007700]])){[/COLOR]
    [COLOR= #0000BB]$data[/COLOR][COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"INSERT INTO Domein (Registrar, Naam, Extensie, Verloopdatum, Whois, id) VALUES ("[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]Registrar[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]","[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]Naam[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]","[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]Extensie[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]","[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]Verloopdatum[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]","[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]Whois[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]","[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]")"[/COLOR][COLOR= #007700];[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$data[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$mysql[/COLOR][COLOR= #007700])) {[/COLOR]
        [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]Error: [/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());
    }[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Domein toegevoegd"[/COLOR][COLOR= #007700];[/COLOR]
    [URL="http://www.php.net/mysql_close"]mysql_close[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$mysql[/COLOR][COLOR= #007700]);
}[/COLOR]
?>

<html>
<body>
<form action="index.php" method="post">
Registrar: <input type="text" name="Registrar" />
Naam: <input type="text" name="Naam" />
Extensie: <input type="text" name="Extensie" />
Verloopdatum: <input type="text" name="Verloopdatum" />
Whois: <input type="text" name="Whois" />
id: <input type="text" name="id" /><br />
<input type="submit" name="verstuur" />
</form>
</body>
</html>


Zo zou hij moeten werken.
0
Braam

Lid · Topicstarter

Berichten
6.867
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Bedankt voor de snelle reacties..

Dat ik daar niet aan dacht aah
0
Braam

Lid · Topicstarter

Berichten
6.867
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
toevoeging op 3 januari 2012, 21:08:39:
Bump & volgend probleem.

Ik probeer mijn code in het eeros systeem te integreren.

Parse error: syntax error, unexpected T_IF in /home/xrayz/domains/****.eu/public_html/pd/pagina/new.php on line 8

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]mysql.php[/COLOR][COLOR= #007700]);[/COLOR]

[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$leden[/COLOR][COLOR= #007700]->[/COLOR]is_ingelogd[COLOR= #007700]())[/COLOR]
[COLOR= #0000BB]$tbl[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #DD0000]"Domein"[/COLOR][COLOR= #007700];[/COLOR] 
[COLOR= #0000BB]$bramistrol[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]" . $mysql->real_escape($leden->getId()) . "[/COLOR] 

[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]Registrar[/COLOR][COLOR= #007700]])){[/COLOR]  [COLOR= #0000BB]$data[/COLOR][COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"INSERT INTO Domein (Registrar, Naam, Extensie, Verloopdatum, Whois, lid) VALUES ("[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]Registrar[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]","[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]Naam[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]","[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]Extensie[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]","[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]Verloopdatum[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]","[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]Whois[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]", $bramistrol);"[/COLOR][COLOR= #007700];[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$data[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$mysql[/COLOR][COLOR= #007700])) {[/COLOR]
        [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]Error: [/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());
    }[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Domein toegevoegd"[/COLOR][COLOR= #007700];[/COLOR]
    [URL="http://www.php.net/mysql_close"]mysql_close[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$mysql[/COLOR][COLOR= #007700]);
}[/COLOR]
?>

<html>
<body>
<form action="index.php" method="post">
Registrar: <input type="text" name="Registrar" />
Naam: <input type="text" name="Naam" />
Extensie: <input type="text" name="Extensie" />
Verloopdatum: <input type="text" name="Verloopdatum" />
Whois: <input type="text" name="Whois" />
<input type="submit" name="verstuur" />
</form>
</body>
</html>
0
Berichten
832
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Lijn 6 :
$bramistrol = " . $mysql->real_escape($leden->getId()) . "
>
$bramistrol = " . $mysql->real_escape($leden->getId()) . ";


Je sloot het niet af yummie
0
Braam

Lid · Topicstarter

Berichten
6.867
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Guillamos schreef:
Lijn 6 :
$bramistrol = " . $mysql->real_escape($leden->getId()) . "
>
$bramistrol = " . $mysql->real_escape($leden->getId()) . ";
Je sloot het niet af yummie
Pff, bedankt.

Alleen interpreteert mijn database het ook als . $mysql->real_escape($leden->getId()) .
0
Berichten
13.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
ik snap niet waarom je dat " . ervoor en . " erachter zet. Het hoort gewoon dit te zijn:

$bramistrol = $mysql->real_escape($leden->getId());
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Je kan die hele $bramistrol regel ook gewoon weghalen en alles na de = op de plek van $bramistrol in de query zetten. Veel makkelijker
0
Braam

Lid · Topicstarter

Berichten
6.867
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]"mysql.php"[/COLOR][COLOR= #007700]);[/COLOR]

[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$leden[/COLOR][COLOR= #007700]->[/COLOR]is_ingelogd[COLOR= #007700]())[/COLOR]
[COLOR= #0000BB]$bramistrol[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$mysql[/COLOR][COLOR= #007700]->[/COLOR]real_escape[COLOR= #007700]([/COLOR][COLOR= #0000BB]$leden[/COLOR][COLOR= #007700]->[/COLOR]getId[COLOR= #007700]());[/COLOR]
[COLOR= #FF8000]// select record from mysql[/COLOR]
[COLOR= #0000BB]$sql[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #DD0000]"SELECT * FROM Domein WHERE lid = $bramistrol "[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$result[/COLOR][COLOR= #007700]=[/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700]);[/COLOR]
?>

<table width="100" border="0" cellspacing="1" cellpadding="0">
<tr>
<td><table width="200%" border="0" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td bgcolor="#FFFFFF">&nbsp;</td>
<td colspan="6" bgcolor="#FFFFFF"><strong>Mijn Domeinen</strong> </td>
</tr>
[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/include"]include[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]"top.php"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$rows[/COLOR][COLOR= #007700]=[/COLOR][URL="http://www.php.net/mysql_fetch_array"]mysql_fetch_array[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$result[/COLOR][COLOR= #007700])){[/COLOR]
 ?>
<tr>
<td bgcolor="#FFFFFF">[COLOR= #0000BB]<?[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$rows[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]Registrar[/COLOR][COLOR= #007700]];[/COLOR] ?></td>
<td bgcolor="#FFFFFF">[COLOR= #0000BB]<?[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$rows[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]Naam[/COLOR][COLOR= #007700]];[/COLOR] ?></td>
<td bgcolor="#FFFFFF">[COLOR= #0000BB]<?[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$rows[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]Extensie[/COLOR][COLOR= #007700]];[/COLOR] ?></td>
<td bgcolor="#FFFFFF">[COLOR= #0000BB]<?[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$rows[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]Verloopdatum[/COLOR][COLOR= #007700]];[/COLOR] ?></td>
<td bgcolor="#FFFFFF">[COLOR= #0000BB]<?[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$rows[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]Whois[/COLOR][COLOR= #007700]];[/COLOR] ?></td>
<td bgcolor="#FFFFFF"><a href="?p=delete_ac?id=[COLOR= #0000BB]<?[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$rows[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]];[/COLOR] ?>">Verwijder</a></td>
</tr>
[COLOR= #0000BB]<?[/COLOR]

[COLOR= #FF8000]// close while loop[/COLOR]
[COLOR= #007700]}[/COLOR]

[COLOR= #FF8000]// close connection;[/COLOR]
[URL="http://www.php.net/mysql_close"]mysql_close[/URL][COLOR= #007700]();[/COLOR]

?>
</table></td>
</tr>
</table>
<br />
Voeg een nieuw domein toe: <br />
[COLOR= #0000BB]<?[/COLOR] [URL="http://www.php.net/include"]include[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]"new.php"[/COLOR][COLOR= #007700]);[/COLOR] ?>


Ik word echt gek,

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/xrayz/domains/gtamod.eu/public_html/pd/pagina/domein.php on line 19
0
Berichten
8.602
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
$sql="SELECT * FROM Domein WHERE lid = $bramistrol ";

->

$sql="SELECT * FROM Domein WHERE lid = " . $bramistrol . " ";
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren