Click here to Skip to main content
15,886,873 members
Home / Discussions / Web Development
   

Web Development

 
QuestionJSON UI to SQL DB Pin
VarunSharma4326-Aug-16 1:15
professionalVarunSharma4326-Aug-16 1:15 
AnswerRe: JSON UI to SQL DB Pin
Nathan Minier30-Aug-16 1:08
professionalNathan Minier30-Aug-16 1:08 
GeneralRe: JSON UI to SQL DB Pin
VarunSharma4330-Aug-16 3:14
professionalVarunSharma4330-Aug-16 3:14 
QuestionWEBSITE TO SELL CARS Pin
akshay kariyanapillil24-Aug-16 6:26
akshay kariyanapillil24-Aug-16 6:26 
AnswerRe: WEBSITE TO SELL CARS Pin
Vincent Maverick Durano24-Aug-16 6:54
professionalVincent Maverick Durano24-Aug-16 6:54 
AnswerRe: WEBSITE TO SELL CARS Pin
Richard Deeming24-Aug-16 7:02
mveRichard Deeming24-Aug-16 7:02 
Questionusage of $.validator.unobtrusive.parse Pin
Raghavendra.Kodimala19-Aug-16 22:35
professionalRaghavendra.Kodimala19-Aug-16 22:35 
Questionlearning to upgrade code Pin
Member 1244422419-Aug-16 17:14
Member 1244422419-Aug-16 17:14 
Hi, I'm trying to write code with prepared stmt but only code is displayed. Anyone?

PHP
<?php
$con = new mysqli('localhost', 'root', 'cookie', 'homedb');
if ($con->connect_error)
    { echo 'Cannot Connect to mySQL: ', $con->connect_error(); } 
else
 { 
if (isset($_POST['url']))
 { 
	$stmt = $con->prepare('
    SELECT url, username, password, purpose, emailused, date-time, count, saved
			FROM emailtbl
			WHERE url = ? ');
		$stmt->bindValue(1, $_POST['url']);
		$stmt->execute();		
		if ($row = $stmt->fetch())
 {		
	echo '
		<table class="emailResults">
	<caption>
	Email Activity for ', htmlspecialchars($_POST['url']), '
		</caption>
		<thead>
		<tr>
<th scope="col">url</th>							
 <th scope="col">Username</th>
  <th scope="col">Password</th>
   <th scope="col">Purpose</th>
    <th scope="col">E-Mail Used</th>
      <th scope="col">date-time</th>
      <th scope="col">count</th>  
          <th scope="col">Saved</th>
  </tr>
          </thead><tbody>';					
		do
 {			
	echo '
	<tr>';						
  foreach ($row as $value) echo '
		<td>', $value, '</td>';						
	echo '
   </tr>';
 } 
    while ($row = $stmt->fetch());			
	echo '
	</tbody></table>';			
 } 
else echo '<div class="error">No Results Found</div>';		
 } 
else echo '<div class="error">No valid "url" for Query</div>';	
}
$stmt = $con->prepare('
	UPDATE emailtbl
	SET date-time=DATE();
             count=count + 1'
	WHERE url = ? ');
    $stmt->bindParam(s, $_POST['url']); 
      $stmt->execute();
   echo $stmt->error ? '
	<div class="error">
  url update query error: ' . $stmt->error . '
	</div>
' : ( $stmt->affected_rows > 0 ? '
	<div class="success">
		Success! Updated ' . $stmt->affected_rows . ' records.
	</div>
' : '
	<div class="error">
	FAILED! No records updated.
	<div>
');
?>

</body></html>
SuggestionRe: learning to upgrade code Pin
ZurdoDev24-Aug-16 7:45
professionalZurdoDev24-Aug-16 7:45 
Questiontrouble with MYSQLi dropdown Pin
Member 1244422418-Aug-16 15:19
Member 1244422418-Aug-16 15:19 
SuggestionRe: trouble with MYSQLi dropdown Pin
Richard Deeming19-Aug-16 3:27
mveRichard Deeming19-Aug-16 3:27 
Questionweb form 2010 display error message Pin
dcof16-Aug-16 5:00
dcof16-Aug-16 5:00 
AnswerRe: web form 2010 display error message Pin
ZurdoDev24-Aug-16 7:48
professionalZurdoDev24-Aug-16 7:48 
QuestionProblem Accessing Site Hosted in IIS Pin
Kevin Marois15-Aug-16 16:13
professionalKevin Marois15-Aug-16 16:13 
QuestionWhat makes an excellent web developer? Pin
DesignersX12-Aug-16 19:16
professionalDesignersX12-Aug-16 19:16 
AnswerRe: What makes an excellent web developer? Pin
Richard MacCutchan12-Aug-16 22:17
mveRichard MacCutchan12-Aug-16 22:17 
AnswerRe: What makes an excellent web developer? Pin
Nathan Minier15-Aug-16 1:14
professionalNathan Minier15-Aug-16 1:14 
GeneralRe: What makes an excellent web developer? Pin
petter201230-Aug-16 19:26
petter201230-Aug-16 19:26 
GeneralRe: What makes an excellent web developer? Pin
Nathan Minier31-Aug-16 1:59
professionalNathan Minier31-Aug-16 1:59 
GeneralRe: What makes an excellent web developer? Pin
petter201231-Aug-16 13:43
petter201231-Aug-16 13:43 
GeneralRe: What makes an excellent web developer? Pin
Nathan Minier1-Sep-16 0:58
professionalNathan Minier1-Sep-16 0:58 
AnswerRe: What makes an excellent web developer? Pin
Mohd Shibli21-Sep-16 7:32
professionalMohd Shibli21-Sep-16 7:32 
Questionconverting string to html Pin
Raghavendra.Kodimala11-Aug-16 4:18
professionalRaghavendra.Kodimala11-Aug-16 4:18 
AnswerRe: converting string to html Pin
Richard MacCutchan11-Aug-16 4:25
mveRichard MacCutchan11-Aug-16 4:25 
AnswerRe: converting string to html Pin
W Balboos, GHB11-Aug-16 8:36
W Balboos, GHB11-Aug-16 8:36 

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.