Hirdetés
Új hozzászólás Aktív témák
-
Retekegér
MODERÁTOR
Hali!
Most kezdtem el hobbiból a PHP&MySQL párossal foglalkozni. Az ultraweben tesztelgetem a kódokat, most azonban elakadtam. Van egy form, ami bekéri az adatokat, amiket aztán szeretnék egy adattömben tárolni php segítségével. Íme:
<html>
<head>
<title>Alien Abduction Report</title>
</head>
<body>
<?php
$first_name = $_POST['firstname'];
$last_name = $_POST['lastname'];
$when_it_happened = $_POST['whenithappened'];
$how_long = $_POST['howlong'];
$how_many = $_POST['howmany'];
$what_they_did = $POST_['whattheydid'];
$alien_description = $_POST['aliendescription'];
$fang_spotted = $_POST['fangspotted'];
$email = $_POST['email'];
$other = $_POST['other'];
$dbc = mysqli_connect('sql4.ultraweb.hu', 'felhasználó', 'jelszó', 'adatbázis')
or die('Error connecting to MySQL server');
$query = "INSERT INTO aliens_abduction (first_name, last_name, when_it_happened,".
"how_long, how_many, alien_description, what_they_did, fang_spotted, other, email)".
"VALUES ('$first_name', '$last_name', '$when_it_happened', '$how_long', '$how_many',".
"'$alien_description', '$what_they_did', '$fang_spotted', '$other', '$email')";
$result = mysqli_query($dbc, $query)
or die('Error querying database');
mysqli_close($dbc);
echo 'Thanks for submitting the form. <br />';
echo 'You were abducted ' .$when_it_happened;
echo ' and were gone for ' .$how_long. '<br />';
echo 'Number of aliens you have seen: '.$how_many. '<br />';
echo 'The aliens did this: ' .$what_they_did. '<br />';
echo 'Description about them: ' .$alien_description. '<br />';
echo 'Was Fang there? ' .$fang_spotted. '<br />';
echo 'Other comments: '.$other. '<br />';
echo 'Your e-mail address is: ' .$email;
?>
</body>
</html>Ilyen hibaüzit kapok:
Fatal error: Call to undefined function: mysqli_connect() in /mnt/ultraweb/./../....../....../report.php on line 18
Ha átírom a mysqli-t szimpla mysql-re, akkor ez lesz az üzenet:
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /mnt/ultraweb/./../....../....../report.php on line 26
Error querying databaseTudna-e segíteni valaki, hogy megtaláljam a hibát.
Előre is köszi!
Új hozzászólás Aktív témák
- Fotók, videók mobillal
- Lexus, Toyota topik
- E-roller topik
- Okos Otthon / Smart Home
- Vezetékes FEJhallgatók
- Milyen routert?
- Soundbar, soundplate, hangprojektor
- Visszagyorsítja a Windows visszalassulását a GeForce driver gyorsjavítása
- Számos VGA kihalhat a memóriapánik miatt
- Elektromos autók - motorok
- További aktív témák...
- Iphone 12 64Gb , Foxpost az árban, független, felújított
- Asus ROG Ally Z1 Extreme 2026 októberig Alza garis számlás kézi konzol handheld PC gaming gamer
- Lenovo Y520 I5 7300HQ GTX 1050 TI 16gb ram 256/1Tb
- XPS 9320 27% 13.4" 3.5K OLED érintő i7-1260P 32GB 1TB NVMe ujjolv IR kam gar
- Latitude 7430 27% 14" FHD IPS i7-1265U 16GB 512GB NVMe magyar vbill IR kam gar
- ÚJ GIGABYTE A16 3VH - 16" WUXGA 165Hz - Ryzen 7 260 - 16GB - 1TB - Win11 - RTX 5060 - 3 év garancia
- HP Thunderbolt 4 kábel
- GYÖNYÖRŰ iPhone 12 Mini 64GB Black -1 ÉV GARANCIA - Kártyafüggetlen, MS3647
- Microsoft Windows, Office & Vírusirtók: Akciók, Azonnali Szállítás, Garantált Minőség, Garancia!
- Telefon felváráslás!! Samsung Galaxy S22/Samsung Galaxy S22+/Samsung Galaxy S22 Ultra
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest


