Rij nummer komt niet na zoeken

Overzicht Reageren

Sponsored by: Vacatures door Monsterboard

Senior, Medior and Junior SAP HANA Developer

Vacature details Vakgebied: Software/IT Opleiding: Medior Werklocatie: Veldhoven Vacature ID: 12696 Introductie Our client is the world's leading provider of lithography systems for the semiconductor industry, manufacturing complex machines that are critical to the production of integrated circuits or chips. Our purpose is “unlocking the potential of people and society by pushing technology to new limits”. We do this guided by the principles “Challenge”, “Collaborate” and “Care”. Wat verwachten we van jou? SAP Certified Application Associate - SAP HANA Cloud Modeling (training and/or certification) Bachelor degree or higher Excellent understanding of SAP HANA (2.0 / Cloud), Data Modelling and writing

Bekijk vacature »

Marco Apeldoorn

Marco Apeldoorn

29/04/2013 18:00:06
Quote Anchor link
Hoi,

Ik heb een probleem met de het volgende stukje code

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
<?php
$zoek
=$_POST['fadver'];
$query="SELECT * FROM $tabel WHERE advertentie = ".$zoek;
$result = mysqli_query($con,$query);
$row = mysqli_fetch_array($result, MYSQLI_BOTH);

echo "Advertentie ".$_POST['fadver']."<br>";
echo "Recordnummer ".$row."<br>";

$adverE=$row['advertentie'];
$datumE=$row['datum'];
$actiefE=$row['actief']
?>


$row word als "Array" getoond, dit moet een waarde zijn die daarna verder gebruikt word om data op te halen.

Wat zit er fout?

Alvast bedankt
 
PHP hulp

PHP hulp

08/05/2024 16:23:56
 
- Ariën  -
Beheerder

- Ariën -

29/04/2013 18:10:11
Quote Anchor link
Je moet het veldnaam uit de database ook meegeven:
$row['veldnaam']

Even wat opmerkingen:
- Je script is gevoelig voor SQL-injection. Dus gebruik mysqli_real_escape_string() over je $_POSt heen.
- Kopieeren van variabelen is onnodig, zie lijn 2, en 10 t/m 12
- Voeg foutafhandeling toe op je query, en kijk je je $result gelukt is
- Controleer met if($_SERVER['REQUEST_METHOD']=="POST") { of je formulier met de POST-methode verstuurd is.
 



Overzicht Reageren

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.