
anton_1
Members-
Posts
66 -
Joined
-
Last visited
Never
Everything posted by anton_1
-
Thanks man. the link is working fine just now I just cant get it to call the onlclick function?
-
Thanks in advance for any help guys <script type="text/javascript"> function showDialog() { $('#box').fadeIn(250); $('#box').fadeTo(0.5); } function hideDialog() { $('#box').fadeOut(250); } </script> <?php $strLink = "<a href='viewTicket.php?id={$row['id']}'>$strName</a>"; ?>
-
Thank you ever so much lol! Iv been trying to update the wrong table. turning all errors ON showed me lol
-
values are prceeding into update script but not changing the values in the db Any help is greatly appreciated! <?php mysql_connect('localhost', 'web101-db1-1', ''pass''); mysql_select_db('web101-db1-1'); ini_set('display_errors', 1); error_reporting(-1); $valueFrom = $_POST['Assign']; $id=mysql_real_escape_string($_POST["id"]); $query="UPDATE Helpdesk SET AssignedTo ='$valueFrom' WHERE id='$id'"; //not sure what goes after where? mysql_query($query); echo $query; echo "The Ticket is Now Assigned to" . $valueFrom; ?> i echo the query and get UPDATE Helpdesk SET AssignedTo ='Anthony Spence' WHERE id='2'The Ticket is Now Assigned toAnthony Spence cant see why its not updating :s
-
That was an old variable which I have now changed. <?php ini_set('display_errors', 1); error_reporting(-1); $value = $_POST['Assign']; var_dump($value); mysql_connect('localhost', 'web101-db1-1', ''); mysql_select_db('web101-db1-1'); $query="UPDATE Helpdesk WHERE AssignedTo ='$value'"; mysql_query($query); echo "Record Updated"; mysql_close(); ?> Thanks
-
string(0) "" Notice: Undefined variable: ud_id in /home/sites/mysite/public_html/UpdateFields.php on line 19 Record Updated thats what im getting now
-
<?php echo $value = $_POST['Assign']; mysql_connect('localhost', 'web101-db1-1', 'Hiyapal2'); mysql_select_db('web101-db1-1'); $query="UPDATE Helpdesk WHERE AssignedTo ='$ud_id'"; mysql_query($query); echo "Record Updated"; mysql_close(); ?> Still displaying nothing, it doesnt seem to be taking the value from the previous page
-
This help is really appreciated WebStyles! this is what I have now echo '<form action="UpdateFields.php" method="post">'; $data = @mysql_query("select AssignedTo from Tickets"); echo "<p>Assigned To:"; echo '<br>'; echo '<br>'; echo '<Select Name="Assign">'; while ($row = mysql_fetch_assoc($data)) { $id = $row['id']; $year = $row['AssignedTo']; echo "<option value='".$id."'>".$year."</option>"; } echo "</select>"; echo "</p>"; to this page: <?php $value = $_POST['Assign']; mysql_connect('localhost', 'web101-db1-1', 'Hiyapal2'); mysql_select_db('web101-db1-1'); $query="UPDATE Helpdesk WHERE AssignedTo ='$ud_id'"; mysql_query($query); echo "Record Updated"; mysql_close(); ?> Nothing being displayed?
-
The only thing that displays is the record updated although nothing is being updated. $value = $_POST['Assign']; isnt showing anything Thanks again!
-
thank you ever so much! How would I recieve that value in the update page?
-
Still everywhere :s Thanks
-
hey man! thanks! can you re-post that code when I copy and paste it its all over the place. Thanks again!
-
Thanks! When I change it to search nothing appears? it needs to know when the form is submitted?
-
Hey guys cannot get data to display after search submitted. Thanks for your time! <form method="post" action="search.php" > <input type="hidden" name="submitted" value="true" /> <label>Search Criteria: <input type="text" name="criteria" /></label> <input type="Submit" value="Search" /> </form> <?php if (isset($_POST['submitted'])) { $criteria = $_POST['criteria']; mysql_connect('localhost', 'web101-db1-1', 'mypassword'); mysql_select_db('web101-db1-1'); $query = "SELECT * FROM Tickets WHERE $criteria LIKE '%".$criteria."%' "; $result = mysql_query($query); echo "$num_rows Tickets Found!"; echo "</br>"; echo "</br>"; echo "</br>"; echo "<table>"; echo "<tr><th>Ticket ID</th><th>Date</th><th>Status</th><th>Requested By</th><th>Assigned To</th><th>Description</th></tr>"; while ($row = mysqli_fetch_array($result)) { echo "<tr><td>"; echo $row['id']; echo "</td><td>"; echo $row['DateCreated']; echo "</td><td>"; echo $row['Status']; echo "</td><td>"; echo $row['RequestedBy']; echo "</td><td>"; echo $row['AssignedTo']; echo "</td><td>"; echo $row['Description']; echo "</td><td>"; } echo "</table>"; } echo "</br>"; echo "</br>"; echo "</br>"; echo "</br>"; echo "<a href='loggedin.php'>Helpdesk</a><br> "; ?>
-
Hey guys, Every help would be greatly apperciated! having a bit of bother updating my database when a user selects a value from the drop down menu here is the code: echo '<form action="UpdateFields.php" method="post">'; $data = @mysql_query("select AssignedTo from Tickets"); echo "<p>Assigned To:"; echo '<br>'; echo '<br>'; echo '<Select Name="Assign">'; while ($row = mysql_fetch_assoc($data)) { $ID = $row['id']; $year = $row['AssignedTo']; echo "<option value=$id>$year"; } echo "</select>"; echo "</p>"; $data = @mysql_query("select Status from Tickets"); echo "<p>Status:"; echo '<br>'; echo '<br>'; echo '<Select Name="Stat">'; while ($row = mysql_fetch_assoc($data)) { $ID = $row['id']; $year = $row['Status']; echo "<option value=$id>$year"; } echo "</select>"; echo "</p>"; echo '<br>'; echo '<br>'; echo '<input type="submit" name="update" value="Update!" />'; echo '</form>'; goes to: <?php $ud_id = $_POST['Assign']; mysql_connect('localhost', 'web101-db1-1', 'mypassword'); mysql_select_db('web101-db1-1'); $query="UPDATE Helpdesk '"; //not sure what goes here mysql_query($query); echo "Record Updated"; mysql_close(); ?>
-
Hey guys, Every help would be greatly apperciated! having a bit of bother updating my database when a user selects a value from the drop down menu here is the code: echo '<form action="UpdateFields.php" method="post">'; $data = @mysql_query("select AssignedTo from Tickets"); echo "<p>Assigned To:"; echo '<br>'; echo '<br>'; echo '<Select Name="Assign">'; while ($row = mysql_fetch_assoc($data)) { $ID = $row['id']; $year = $row['AssignedTo']; echo "<option value=$id>$year"; } echo "</select>"; echo "</p>"; $data = @mysql_query("select Status from Tickets"); echo "<p>Status:"; echo '<br>'; echo '<br>'; echo '<Select Name="Stat">'; while ($row = mysql_fetch_assoc($data)) { $ID = $row['id']; $year = $row['Status']; echo "<option value=$id>$year"; } echo "</select>"; echo "</p>"; echo '<br>'; echo '<br>'; echo '<input type="submit" name="update" value="Update!" />'; echo '</form>'; goes to: <?php $ud_id = $_POST['Assign']; mysql_connect('localhost', 'web101-db1-1', 'Hiyapal2'); mysql_select_db('web101-db1-1'); $query="UPDATE Helpdesk '"; //not sure what goes here mysql_query($query); echo "Record Updated"; mysql_close(); ?>
-
it's complaining about this line echo "<Select Name="ID">n";
-
Thanks for your time guys: $data = @mysql_query("select * from names"); echo "<p>Select a Name: n"; echo "<Select Name="ID">n"; while ($row = mysql_fetch_assoc($data)) { $ID = $row['ID']; $year = $row['name']; echo "<option value=$ID>$namen"; } echo "</select>n"; echo "</p>n";
-
Hey Gys that was awesome advice. it now get's the id but when I proceed it doesnt fetch the row according to the id : <html> <head> <title>Retrieve data from database</title> </head> <body> <dl> <?php $f1 = $_GET['f1']; echo $f1; mysql_connect('localhost', 'web101-db1-1', 'mypassword'); mysql_select_db('web101-db1-1'); $id = mysql_real_escape_string($_GET['$currentid']); // or $id = (int) $_GET['id']; if($id){ $strSQL = "SELECT * FROM Tickets WHERE TicketID=" . $_GET["$id"]; // Get data from the database depending on the value of the id in the URL $rs = mysql_query($strSQL); // Loop the recordset $rs while($row = mysql_fetch_array($rs)) { // Write the data of the person echo "<dt>Id Number:</dt><dd>" . $row["TicketID"] . "</dd>"; } }else { echo "No ID Found"; } // Close the database connection mysql_close(); ?> </dl> <p><a href="login_success.php">Return to Helpdesk</a></p> </body> </html>
-
Hey guys any help will be greatly appreciated! What im trying to do is display the selected row from database when clicked but i cannot get php to get the id number? Here is the code: <?php mysql_connect('localhost', 'web101-db1-1', 'mypassword'); mysql_select_db('web101-db1-1'); $query="SELECT * FROM Tickets"; $result=mysql_query($query); $num=mysql_num_rows($result); mysql_close(); ?> <table border="1"> <tr> <th><font face="Arial, Helvetica, sans-serif">TicketID</font></th> <th><font face="Arial, Helvetica, sans-serif">Date Created</font></th> <th><font face="Arial, Helvetica, sans-serif">Status</font></th> <th><font face="Arial, Helvetica, sans-serif">Assigned To</font></th> <th><font face="Arial, Helvetica, sans-serif">Requested By</font></th> <th><font face="Arial, Helvetica, sans-serif">Description</font></th> <th><font face="Arial, Helvetica, sans-serif">View Ticket</font></th> </tr> <?php $i=0; while ($i < $num) { $f1=mysql_result($result,$i,"TicketID"); $f2=mysql_result($result,$i,"DateCreated"); $f3=mysql_result($result,$i,"Status"); $f4=mysql_result($result,$i,"AssignedTo"); $f5=mysql_result($result,$i,"RequestedBy"); $f6=mysql_result($result,$i,"Description"); ?> <tr> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f1; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f2; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f3; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f4; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f5; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo $f6; ?></font></td> <td><font face="Arial, Helvetica, sans-serif"><?php echo "<a href='view.php?id={$row['id']}'>View Ticket</a>" ?></font></td> //where i try and get the id </tr> <?php $i++; } ?>
-
Hey! I ended up getting it lol. extra bracket Thanks alot for your help! Ant
-
Yes for now, until I encrypt them with md5. Thanks guys
-
it doesnt display anything. it just does nothing? Thanks
-
Hey Guys, This was working all day until now. Can you guys see anything im missing? <?php session_start(); $username = $_POST['username']; $password = $_POST['password']; $EmployeeID = $_POST['EmployeeID']; mysql_connect('localhost', 'web101-db1-1', 'mypasssord'); mysql_select_db('web101-db1-1'); // To protect MySQL injection (more detail about MySQL injection) $username = stripslashes($username); $password = stripslashes($password); $username = mysql_real_escape_string($username); $password = mysql_real_escape_string($password); $sql="SELECT * FROM regme WHERE username='$username' AND password='$password'"; $result=mysql_query($sql); // Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched $myusername and $mypassword, table row must be 1 row if($count==1){ // Register $myusername, $mypassword and redirect to file "login_success.php" session_register("username"); session_register("password"); $_SESSION["username"] = $_POST["username"]; $_SESSION["EmployeeID"] = $_POST["EmployeeID"]; header("location:login_success.php"); } else { echo "Wrong Username or Password"; } ?> Thanks in advance
-
thank you again for your help! it works now! briliant!