Click here to Skip to main content
15,888,521 members
Home / Discussions / Web Development
   

Web Development

 
GeneralRe: Require Js Pin
Suraj Sahoo | Coding Passion16-Sep-14 21:50
professionalSuraj Sahoo | Coding Passion16-Sep-14 21:50 
AnswerRe: Require Js Pin
thatraja18-Sep-14 3:29
professionalthatraja18-Sep-14 3:29 
GeneralRe: Require Js Pin
Suraj Sahoo | Coding Passion18-Sep-14 4:04
professionalSuraj Sahoo | Coding Passion18-Sep-14 4:04 
GeneralRe: Require Js Pin
thatraja18-Sep-14 4:14
professionalthatraja18-Sep-14 4:14 
GeneralRe: Require Js Pin
Suraj Sahoo | Coding Passion18-Sep-14 4:16
professionalSuraj Sahoo | Coding Passion18-Sep-14 4:16 
Generalpop up on button click in wordpress Pin
AMRITESH ASTHANA15-Sep-14 2:19
AMRITESH ASTHANA15-Sep-14 2:19 
QuestionVideo streaming in web Pin
Dharmaraj Balasubramanian15-Sep-14 2:03
Dharmaraj Balasubramanian15-Sep-14 2:03 
QuestionMessage Closed Pin
7-Sep-14 9:21
hadoopTraining7-Sep-14 9:21 
QuestionWeb API - Pros And Cons of more open structure. Pin
Rover2341 - Mark Dickinson7-Sep-14 7:46
Rover2341 - Mark Dickinson7-Sep-14 7:46 
Questionerror has acquired with registration form Pin
Member 110638926-Sep-14 14:57
Member 110638926-Sep-14 14:57 
AnswerRe: error has acquired with registration form Pin
Richard Andrew x646-Sep-14 16:03
professionalRichard Andrew x646-Sep-14 16:03 
GeneralRe: error has acquired with registration form Pin
Member 110638926-Sep-14 16:57
Member 110638926-Sep-14 16:57 
GeneralRe: error has acquired with registration form Pin
Member 110638926-Sep-14 17:01
Member 110638926-Sep-14 17:01 
QuestionFile Upload Using Query String in PHP Pin
jasonalien3-Sep-14 20:48
jasonalien3-Sep-14 20:48 
AnswerRe: File Upload Using Query String in PHP Pin
Richard MacCutchan3-Sep-14 21:31
mveRichard MacCutchan3-Sep-14 21:31 
GeneralRe: File Upload Using Query String in PHP Pin
jasonalien3-Sep-14 21:33
jasonalien3-Sep-14 21:33 
GeneralRe: File Upload Using Query String in PHP Pin
Richard MacCutchan3-Sep-14 22:05
mveRichard MacCutchan3-Sep-14 22:05 
AnswerRe: File Upload Using Query String in PHP Pin
Richard Deeming4-Sep-14 1:37
mveRichard Deeming4-Sep-14 1:37 
GeneralRe: File Upload Using Query String in PHP Pin
jasonalien4-Sep-14 2:04
jasonalien4-Sep-14 2:04 
QuestionHow to update a form and submit using jquery and ajax Pin
Member 109499862-Sep-14 6:41
Member 109499862-Sep-14 6:41 
SuggestionRe: How to update a form and submit using jquery and ajax Pin
Kornfeld Eliyahu Peter2-Sep-14 7:12
professionalKornfeld Eliyahu Peter2-Sep-14 7:12 
Questionvb.net web form generates extra blank lines Pin
dcof1-Sep-14 7:31
dcof1-Sep-14 7:31 
Questionmysqli update Pin
Charlie Kirk26-Aug-14 15:32
Charlie Kirk26-Aug-14 15:32 
XML
Hi, The following code selects and displays a record from the "emailtbl" table
as desired except for the the date and it doesn't update the "lastused" (date)
field to the "numbers" table via "lastused.php" include. No error messages. I need help.

<pre lang="PHP"><html><head>
</head>
<BODY>
     <?php
include ("lastused.php");
include ("counter.php");
$id="''";
    $con=mysqli_connect("localhost","root","cookie","homedb");

    // ============== check connection

    if(mysqli_errno($con))
    {echo "Can't Connect to mySQL:".mysqli_connect_error();}
    else
    {echo "</br>";}

// ==========This creates the drop down box using records in the table

       echo "<select name= 'target'>";
    echo '<option value="">'.'---select email account ---'.'</option>';
    $query = mysqli_query($con,"SELECT target FROM emailtbl");
    $query_display = mysqli_query($con,"SELECT * FROM emailtbl");
    while($row=mysqli_fetch_array($query))
    { echo "<option class=highlight value='". $row['target']."'>".$row['target']
    .'</option>';}
    echo '</select>';
    ?>
<input type="submit" name="submit" value="Submit"/>
    </form>
     <?php
        if(isset($_POST['target']))
  {
    $id = ' ';
    $name = $_POST['target'];
    $fetch="SELECT target, username, password, emailused, lastused, purpose, saved FROM emailtbl WHERE target = '$name'";
    $result = mysqli_query($con,$fetch);
    if(!$result)
    {echo "Error:".(mysqli_error($con));}

// =============================== this displays the table

    echo '<table border="1">'.'<tr>'.'<td bgcolor="#FFD47F" align="center">'. 'email menu'. '</td>'.'</tr>';
    echo '<tr>'.'<td>'.'<table border="1">'.'<tr>'.'<td bgcolor="#ccffff">'.'target'.'</td>'.'<td bgcolor="#ccffff">'.'username'.'</td>'.'<td bgcolor="#ccffff">'. 'password' .'</td>'.'<td bgcolor="#ccffff">'. 'emailused'. '</td>'.'<td bgcolor="#FFD47F">'. 'lastused' .'</td>'.'<td bgcolor="#ccffff">'. 'purpose'. '</td>'.'<td bgcolor="#ccffff">'. 'saved' .'</td>'.'</tr>';
//    while( $row = mysqli_fetch_assoc( $result ) )
// while($data = mysqli_fetch_row($fetch))
    while($data=mysqli_fetch_row($result))
    {echo ("<tr><td>$data[0]</td><td>$data[1]</td><td>$data[2]</td><td>$data[3]</td><td>$data[4]</td><td>$data[5]</td><td>$data[6]</td></tr>");}
    echo '</table>'.'</td>'.'</tr>'.'</table>';
  }
    ?>
    </body></html>


lastused.php
PHP
?php
error_reporting(E_ALL);
ini_set('display_errors', true); // set to false for production

if(!empty($_POST['update_lastused']))
 {
    $dbconnect = mysqli_connect('localhost','root','cookie');
    mysqli_select_db($dbconnect, 'homedb') or die( "Unable to select database");

// let prepared statements with bound parameters take care of input sanitation
    $sql = "UPDATE emailtbl SET lastused = NOW() WHERE id = ?";
    $stmt = mysqli_prepare($dbconnect, $sql);

// make sure it worked
    if($stmt == false)
    {throw new Exception("Prepare failed".PHP_EOL.mysqli_error($dbconnect).PHP_EOL.$sql);}
    mysqli_stmt_bind_param($stmt, 'i', $sql);
    $update = mysqli_stmt_execute($stmt);

// ditto
    if($update == false)
    {throw new Exception("Update failed:".PHP_EOL.mysqli_stmt_error($stmt).PHP_EOL.$sql);}
 }
   ?>


AnswerRe: mysqli update Pin
Graham Breach26-Aug-14 22:48
Graham Breach26-Aug-14 22:48 
AnswerRe: mysqli update Pin
Charlie Kirk30-Aug-14 17:47
Charlie Kirk30-Aug-14 17:47 

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.