Click here to Skip to main content
15,904,156 members
Home / Discussions / Linux, Apache, MySQL, PHP
   

Linux, Apache, MySQL, PHP

 
AnswerRe: problem in pagination click Pin
Richard Deeming3-Apr-22 21:36
mveRichard Deeming3-Apr-22 21:36 
GeneralRe: problem in pagination click Pin
irfankundi7864-Apr-22 4:01
irfankundi7864-Apr-22 4:01 
QuestionGUI for Linux Server Pin
Deepak Vasudevan25-Jan-22 3:29
Deepak Vasudevan25-Jan-22 3:29 
QuestionError in page rendering in php Pin
Rahul Gupta Jan202217-Jan-22 1:16
Rahul Gupta Jan202217-Jan-22 1:16 
AnswerRe: Error in page rendering in php Pin
Richard Deeming17-Jan-22 1:53
mveRichard Deeming17-Jan-22 1:53 
Questionhow to add date while importing data in csv from mysql query Pin
him_mca16-Jan-22 20:00
him_mca16-Jan-22 20:00 
Questioni want make check user offline with mysql Pin
Ping tester1-Jul-21 10:56
Ping tester1-Jul-21 10:56 
QuestionHow to print for each primary key all the foreign keys column related to it? Pin
EliotSimpleMan5-May-21 14:40
EliotSimpleMan5-May-21 14:40 
AnswerRe: How to print for each primary key all the foreign keys column related to it? Pin
SeanChupas13-May-21 1:50
SeanChupas13-May-21 1:50 
QuestionHow do I calculate the column in PHP union all function Pin
Developer Account18-Apr-21 23:12
Developer Account18-Apr-21 23:12 
AnswerRe: How do I calculate the column in PHP union all function Pin
SeanChupas13-May-21 1:51
SeanChupas13-May-21 1:51 
QuestionPHP :: VSCode always opens a new blank window (untitled-1) Pin
Gustavo Laufer AU4-Apr-21 22:00
Gustavo Laufer AU4-Apr-21 22:00 
AnswerRe: PHP :: VSCode always opens a new blank window (untitled-1) Pin
SeanChupas5-Apr-21 3:15
SeanChupas5-Apr-21 3:15 
Questioni have this errors in my project please i need help Pin
frank saki24-Mar-21 11:55
frank saki24-Mar-21 11:55 
AnswerRe: i have this errors in my project please i need help Pin
Richard Deeming24-Mar-21 22:12
mveRichard Deeming24-Mar-21 22:12 
QuestionHow can I echo the numbers using list() function in foreach loop? Pin
Best Tutor24-Feb-21 9:33
Best Tutor24-Feb-21 9:33 
QuestionRe: How can I echo the numbers using list() function in foreach loop? Pin
Richard MacCutchan24-Feb-21 21:56
mveRichard MacCutchan24-Feb-21 21:56 
QuestionHow to import csv using php code Pin
Mohammed Hudair16-Feb-21 6:24
Mohammed Hudair16-Feb-21 6:24 
QuestionHow to code login page in html css php Pin
Member 150661826-Feb-21 1:01
Member 150661826-Feb-21 1:01 
AnswerRe: How to code login page in html css php Pin
Richard MacCutchan6-Feb-21 1:27
mveRichard MacCutchan6-Feb-21 1:27 
QuestionPosting dropdown value to database Pin
Member 1505550825-Jan-21 2:27
Member 1505550825-Jan-21 2:27 
Hello.

First of all, i want to apologize for my question, since the code im about to post is way outdated.

I am hosting this script on a server which is running a very old version of php.

The website is used by me and 2 other friends, and we are the only ones able to connect to it, due to .htaccess only showing the page to recognized ip adresses.. So there is no need to protect against sql injection or anything.

Now that thats out of the way, here is the problem i am facing:

i have a php script, which is showing a dropdown menu, with values gathered from a mysql table called chat_clothes.

I then have a submit button, that is supposed to post whatever you have chosen in the dropdown menu, to another table called chat_brugere

But when i click the submit button, it posts "Resource id #7", instead of the selected value.

Here is my code:

PHP
<?php
@session_start();
header('Content-Type: text/html; charset=ISO-8859-1');
include('includes/config.php');
?>
		<link rel="stylesheet" type="text/css" href="css/chat.css" />
<div id="sidebar_header">Garderobe</div>
<div id="sidebar_content">
	<p style="display: inline;">Skid i havet.</p><br /><br />
	<select name="sko">
<?php

	if(isset($_SESSION['logget_ind']) && $_SESSION['logget_ind'] == true) {
		$getSko = mysql_query("SELECT `navn` FROM `chat_clothes` WHERE `ejer` = '".$_SESSION['brugernavn']."' AND `type` = 'sko'");

		
		while ($showSko = mysql_fetch_array($getSko)) {
			echo '<option id="sko" name="sko" style="width: 300px;">'.$showSko['navn'].'</option><br />'
			;
			}
	}
?>

</div>

			</select>
<?php
	if (isset($_POST['sko'])) {
		

						mysql_query("UPDATE chat_brugere SET shoes='".$getSko."' WHERE id='".$_SESSION['id']."'");

						echo 'sko er opdateret!';
				} else {
					echo '';
				}
			
			echo '
			<form action="nygad.php" method="POST">

				<div>
					<table>
					
						<tr>
							<td><center><input type="submit" name="sko" value="Opdater!" /></center></td>
						</tr>
					</table>
				</div>
			</form>
			';
		?>

AnswerRe: Posting dropdown value to database Pin
Richard Deeming25-Jan-21 4:04
mveRichard Deeming25-Jan-21 4:04 
GeneralRe: Posting dropdown value to database Pin
Member 1505550825-Jan-21 6:31
Member 1505550825-Jan-21 6:31 
GeneralRe: Posting dropdown value to database Pin
Richard Deeming25-Jan-21 21:28
mveRichard Deeming25-Jan-21 21:28 
GeneralRe: Posting dropdown value to database Pin
Member 1505550825-Jan-21 21:57
Member 1505550825-Jan-21 21:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.