PHP - [code] Tag Bug ( Deletes All Your Writing )
I found this bug when creating my topic he
http://forums.phpfre...ted-rectangles/
I spent 10 minutes writing up my issue after I copy and pasted my code inside the [code=auto:0] brackets. Then, what do you know? I submitted my post with all my writing below my [code=auto:0] brackets and BOOM it was all gone. Only my code was showing. That's what issued Requinex to reply like that, it's a nasty forum bug.
Here is a video I made to help explain and re-create the issue. Hopefully you guys fix it, thanks!
Similar TutorialsAlright so I'm attempting to save config data via php. Bellow is the code I currently have, however I'm afraid that when I "flip the switch" and use it that it will error out because of the <?php and ?> tags inside of it... Ideas, suggestions? $config = '../includes/config.php'; $fh = fopen($config, 'w'); $data = ' <?php $dbhost = "'.$database_host.'"; $dbuser = "'.$database_username.'"; $dbpass = "'.$database_password.'"; $dbname = "'.$database_name.'"; $key = "'.$site_key.'"; $cron_key = "'.$database_cron_key.'"; ?> '; fwrite($fh, $data); fclose($fh); when the blow code is ran it produces this warning error Quote Warning: filemtime() [function.filemtime]: stat failed for 048_Baby_Colors.png in /home/public_html/.com/kill.php on line 23 The code deletes all the files in the directory no matter how many hours or seconds ago they was last modified. could someone help me figure out why? <?php $dir = '/home/br/public_html/l.com/dfile'; if ($handle = opendir($dir)) { while (false !== ($file = readdir($handle))) { if ($file[0] == '.' || is_dir("$dir/$file")) { continue; } if ((time() - filemtime($file)) > ($days * 604800)) { unlink("$dir/$file"); } } closedir($handle); } ?> Hi Everyone, Sorry I am a complete newbie and am trying to secure my code using MySQLi but I am stuck at mysql_result since there is no equivalent in mysqli. Can someone help me with my code please ?
$total_results = mysqli_query($mysqli,"SELECT COUNT(*) FROM gallery_photos WHERE category_name='" . addslashes($category_name) . "'"); if (!$total_results) { die('Could not query:' . mysqli_error()); } $total_results = mysql_result($total_results, 0);When I use this I am getting an error Warning: mysql_result() expects parameter 1 to be resource, object given in C:\wamp\www\viewgallery.php on line 182 As a solution I was told to use $row = $mysqli_result->fetch_row(); $the_count = $row[0];But I do not know how to add this to my code to make it work. I am sorry if this is too elementary ... I'm using Zebra_Form and I want to populate a select box with some values from a query. How do I do this? I have a returnset from MS SQL Server, but I am a newbie and I am baffled about how to frame it into the required array for Zebra_Form. The below example from the documentation has a hard coded set of values. How can I replace this with my queryset ($stmt printed a little further down) instead? Code: [Select] // single-option select box $obj = &$form->add('select', 'my_select2'); $obj->add_options(array( 'v1' => 'Value 1', 'v2' => 'Value 2', 'v3' => 'Value 3' )); //sql code here * $serverName = "serverName\sqlexpress"; $connectionInfo = array( "Database"=>"dbName", "UID"=>"username", "PWD"=>"password" ); $conn = sqlsrv_connect( $serverName, $connectionInfo); if( $conn === false ) { die( print_r( sqlsrv_errors(), true)); } $sql = "select ticketID, ticketName from tickets order by price desc"; $stmt = sqlsrv_query( $conn, $sql); Hi folks, <?php $filename = "text.txt"; $filename2 = "text2.txt"; $file = file($filename, FILE_SKIP_EMPTY_LINES); foreach($file as $cwb) { $ids[] = "\$id_to_save[] = ".$cwb.";"; } file_put_contents($filename2,implode($ids,"\n\r")); ?> it takes ids from a file and implodes to a new file its supposed to looked like this $id_to_save[] = id; $id_to_save[] = id; $id_to_save[] = id; $id_to_save[] = id; instead it turns out like this $id_to_save[] = 4234324 ; $id_to_save[] = 2342343 ; $id_to_save[] = 3423432 ; $id_to_save[] = 3243244; I've tried trim() but it hasnt seemed to work., any help is appreciated. Thanks am total newbie to programming, apart from knowing SQL, the thing is i have been given a MYSQL database containing various information about kids diseases and a web interface written in php to create reports from the database that can be accessed via the interface. there are almost 25 different variables that need to be computed in the report, i have written sql queries to compute all these values, but i don't know anything about PHP, if i have all these queries isn't there a way for me to combine all these sql queries to be display results on a webpage and come up with this report without writing PHP code? Thanks for your help very sorry if this is too basic Is this true, i have cookies on my site till i send a form which fires off two emails. the cookies are not only deleted, but i can reset the cookie to the proper values unless i delete all my cookies!! any ideas? Hello, I will try to explain this in as much detail as I can. I am probably making a simple mistake but I have gone through the code multiple times and can't figure it out. I have 3 HTML Site tables, pending, accepted and denied applications. I have accept, deny, and delete buttons on all the tables for each row. I could probably do with out the accept and deny buttons on the last two HTML Site tables, but in the case an admin making a mistake and clicking the wrong button. I don't want the admin to have to delete the app and have the user fill out a new one. User experience and all that. My problem: The last two HTML Site tables, Accept and Denied, the three buttons do not function but in Pending they do. I don't remember assigning those functions to one table and looked thought the code and didn't see any place I did it is only looking for id at the displayed row. Enough of my jabbering. Here is what I am working with.
Here is the code, I have done for the deletes and edits to the application status. //DELETE APPLICATION if(isset($_POST['delete'])) { $to_change = mysqli_real_escape_string($conn, $_POST['to_change']); $sql = "DELETE FROM apps WHERE id = $to_change"; if(mysqli_query($conn, $sql)) { $feedback['delete'] = '<div class="green white-text alert-box">Success the user deleted from list.</div>'; header('Location: admin.php'); } else { $feedback['ui_feedback'] = '<div class="red white-text alert-box">Connection Error</div>'; } } else { $feedback['ui_feedback'] = '<div class="red white-text alert-box">Connection Error</div>'; } //UPDATE APPLICATION STATUS TO ACCEPT if(isset($_POST['accept'])) { $to_change = mysqli_real_escape_string($conn, $_POST['to_change']); //QUERY DB mysqli_query($conn, "UPDATE apps SET app_status='Accepted' WHERE id = $to_change"); $feedback['accept'] = '<div class="green white-text alert-box">Success, the user was accepted.</div>'; header('Location: admin.php'); } else { $feedback['ui_feedback'] = '<div class="red white-text alert-box">Connection Error</div>'; } //UPDATE APPLICATION STATUS TO DENIED if(isset($_POST['denied'])) { $to_change = mysqli_real_escape_string($conn, $_POST['to_change']); //QUERY DB mysqli_query($conn, "UPDATE apps SET app_status='Denied' WHERE id = $to_change"); $feedback['denied'] = '<div class="green white-text alert-box">Success, the user was denied.</div>'; header('Location: admin.php'); } else { $feedback['ui_feedback'] = '<div class="red white-text alert-box">Connection Error</div>'; } I know the $feedback doesn't work I wanted to see it worked and it didn't I will research that later. <!-- NEW APPLICATIONS --> <div id="new_apps" class="container white container-style"> <h4 class="blue-text text-darken-3">New Applications</h4> <div class="table-responsive"> <table class="highlight centered row"> <thead> <tr class=""> <th class="blue-text text-darken-3">ID</th> <th class="blue-text text-darken-3">Name</th> <th class="blue-text text-darken-3">Email</th> <th class="blue-text text-darken-3">Discord</th> <th class="blue-text text-darken-3">Steam Hex ID</th> <th class="blue-text text-darken-3">DOB</th> <th class="blue-text text-darken-3">Department</th> <th class="blue-text text-darken-3">Date Applied</th> <th class="blue-text text-darken-3">Status</th> <th class="blue-text text-darken-3">Actions</th> </tr> <tbody class=""> <?php if($pending): ?> <?php foreach($pending as $pend): ?> <tr> <td><?php echo $pend['id']; ?></td> <td><?php echo $pend['first_name'] . " " . $pend['last_name']; ?></td> <td><?php echo $pend['email']; ?></td> <td><?php echo $pend['discord_name']; ?></td> <td><?php echo $pend['steam_hex']; ?></td> <td><?php echo $pend['dob']; ?></td> <td><?php echo $pend['dept_select']; ?></td> <td><?php echo $pend['created_at']; ?></td> <td><?php echo $pend['app_status']; ?></td> <td> <form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="POST"> <input type="hidden" name="to_change" value="<?php echo $pend['id']; ?>"> <button type="submit" name="accept" class="tooltipped btn-floating btn-flat btn-small transparent" data-postion="bottom" data-tooltip="Accept"><i class="material-icons green-text text-darken-3">check_circle</i></button> <button type="submit" name="denied" class="tooltipped btn-floating btn-flat btn-small transparent" data-postion="bottom" data-tooltip="Deny"><i class="material-icons yellow-text text-darken-3">not_interested</i></button> <button type="submit" name="delete" class="tooltipped btn-floating btn-flat btn-small transparent" data-postion="bottom" data-tooltip="Delete"><i class="material-icons red-text text-darken-3">delete</i></button> </form> </td> </tr> </tbody> <?php endforeach; ?> <?php else: ?> <div class="blue darken-3 white-text table-empty-box">There are no applications</div> <?php endif; ?> </thead> </table> </div> </div> <!-- ACCEPTED APPLICATIONS--> <div id="accepted_apps" class="container white container-style"> <h4 class="blue-text text-darken-3">Accepted Applications</h4> <div class="table-responsive"> <table class="highlight centered row"> <thead> <tr class=""> <th class="blue-text text-darken-3">ID</th> <th class="blue-text text-darken-3">Name</th> <th class="blue-text text-darken-3">Email</th> <th class="blue-text text-darken-3">Discord</th> <th class="blue-text text-darken-3">Steam Hex ID</th> <th class="blue-text text-darken-3">DOB</th> <th class="blue-text text-darken-3">Department</th> <th class="blue-text text-darken-3">Date Applied</th> <th class="blue-text text-darken-3">Status</th> <th class="blue-text text-darken-3">Actions</th> </tr> <tbody class=""> <?php if($accepted): ?> <?php foreach($accepted as $accept): ?> <tr> <td><?php echo $accept['id']; ?></td> <td><?php echo $accept['first_name'] ." " . $accept['last_name']; ?></td> <td><?php echo $accept['email']; ?></td> <td><?php echo $accept['discord_name']; ?></td> <td><?php echo $accept['steam_hex']; ?></td> <td><?php echo $accept['dob']; ?></td> <td><?php echo $accept['dept_select']; ?></td> <td><?php echo $accept['created_at']; ?></td> <td><?php echo $accept['app_status']; ?></td> <td> <form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="POST"> <input type="hidden" name="to_change" value="<?php echo $accept['id']; ?>"> <a type="submit" name="accept" class="tooltipped btn-floating btn-flat btn-small transparent" data-postion="bottom" data-tooltip="Accept"><i class="material-icons green-text text-darken-3">check_circle</i></a> <a type="submit" name="denied" class="tooltipped btn-floating btn-flat btn-small transparent" data-postion="bottom" data-tooltip="Deny"><i class="material-icons yellow-text text-darken-3">not_interested</i></a> <a type="submit" name="delete" class="tooltipped btn-floating btn-flat btn-small transparent" data-postion="bottom" data-tooltip="Delete"><i class="material-icons red-text text-darken-3">delete</i></a> </form> </td> </tr> <?php endforeach; ?> <?php else: ?> <div class="blue darken-3 white-text table-empty-box">There are no applications</div> <?php endif; ?> </tbody> </thead> </table> </div> </div> <!-- deniedED APPLICATIONS --> <div id="denieded_apps" class="container white container-style"> <h4 class="blue-text text-darken-3">Denied Applications</h4> <div class="table-responsive"> <table class="highlight centered row"> <thead> <tr class=""> <th class="blue-text text-darken-3">ID</th> <th class="blue-text text-darken-3">Name</th> <th class="blue-text text-darken-3">Email</th> <th class="blue-text text-darken-3">Discord</th> <th class="blue-text text-darken-3">Steam Hex ID</th> <th class="blue-text text-darken-3">DOB</th> <th class="blue-text text-darken-3">Department</th> <th class="blue-text text-darken-3">Date Applied</th> <th class="blue-text text-darken-3">Status</th> <th class="blue-text text-darken-3">Actions</th> </tr> <tbody class=""> <?php if($denied): ?> <?php foreach($denied as $deny): ?> <tr> <td><?php echo $deny['id']; ?></td> <td><?php echo $deny['first_name'] ." " . $deny['last_name']; ?></td> <td><?php echo $deny['email']; ?></td> <td><?php echo $deny['discord_name']; ?></td> <td><?php echo $deny['steam_hex']; ?></td> <td><?php echo $deny['dob']; ?></td> <td><?php echo $deny['dept_select']; ?></td> <td><?php echo $deny['created_at']; ?></td> <td><?php echo $deny['app_status']; ?></td> <td> <form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="POST"> <input type="hidden" name="to_change" value="<?php echo $deny['id']; ?>"> <a type="submit" name="accept" class="tooltipped btn-floating btn-flat btn-small transparent" data-postion="bottom" data-tooltip="Accept"><i class="material-icons green-text text-darken-3">check_circle</i></a> <a type="submit" name="denied" class="tooltipped btn-floating btn-flat btn-small transparent" data-postion="bottom" data-tooltip="Deny"><i class="material-icons yellow-text text-darken-3">not_interested</i></a> <a type="submit" name="delete" class="tooltipped btn-floating btn-flat btn-small transparent" data-postion="bottom" data-tooltip="Delete"><i class="material-icons red-text text-darken-3">delete</i></a> </form> </td> </tr> <?php endforeach; ?> <?php else: ?> <div class="blue darken-3 white-text table-empty-box">There are no applications</div> <?php endif; ?> </tbody> </thead> </table> </div> </div>
Any help would be amazing even if you tell me to look at a line lol I am getting back into php after only doing it for a few weeks after switching to firebase, just coming back to what works and not having limits. Thank you for taking the time to read this! Hi again.... I'm working on a project that creates a profile page for the user (i.e. 'username.php') when they register. Because there are two ways to register, through Facebook and through the website itself, there has to be an if statement in this page that it crates as to which ID to use for that user. Because Facebook usernames are not unique, we must identify a user through their OAuth User ID which is a 10 digit number. When a user registers through the website itself, usernames are unique so their profile page can be ID'd by their username. Here's the code that creates that profile page: function createProfile($user) { $userFile = 'users/'.$result['oauth_uid'].'.php'; $fh = fopen($userFile, 'w') or die("can't open file"); $stringData = "<?php\n" . '$pageowner = "' . $result['oauth_uid'] . '";' . "\n" . 'include "profile.php";' . "\n?>"; fwrite($fh, $stringData); fclose($fh); } $user is the username passed to the function when it's called. Currently that is set to create a line of code in the new profile page ('userid'.php) that looks like this: <?php $pageowner = "100001745088506"; include "profile.php"; ?> I want to add an IF to that page that follows this structu if oauth_provider == facebook { $pageowner = "oauth_uid" } else { $pageowner = username } But I don't know how to write that he $stringData = "<?php\n" . '$pageowner = "' . $result['oauth_uid'] . '";' . "\n" . 'include "profile.php";' . "\n?>"; to make it show up in the page it creates. I want that if statement to be written IN the page that is created. I just don't know the syntax well enough yet to do that. Would somebody help me out or point me in the right direction? Thanks! The title says it all,..well as all u can see, there are many methods to accomplish this done but not before undergoing through a heavy tasking process. For instance, 1. Open the file 2. Reads the content of the file into array. 3. Find out the desire line of text that we want to replace. 4. Make that line of text as variable and assigns with the new data(that we want to replace) as its values. 5.open another file. 6.Write the whole contents to the file opened in 5. 7. Put the contents back to the file of original. Can anyone contributes a better way to get this done? Like replace/delete a specific line without affecting other characters or anything therein? Thanx. P.S reading and using str_replace to make the alteration always ends up in giving some kind of result beyond desired after the first round of code execution. I am using a cache script, well it writes a array to a file like this: Code: [Select] fwrite($fh, '<?php'."\n\n".'define(\'PUN_LOTTERY_LOADED\', 1);'."\n\n".'$lottery = '.var_export($output2, true).';'."\n\n".'?>'); output2 is Code: [Select] $result2 = $db->query('MY QUERY '); $output2 = array(); while ($cur_donors = $db->fetch_assoc($result2)) $output2[] = $cur_donors; Now, I want to ditch the mysql and I want to use this script with 7 variables that I already have loaded, so I dont need to use the mysql, how do I add my 7 variables to my var_export function instead of using mysql to loop them? Hey Guys. I am trying to write to the file depending on which condition is met. The code works fine on my local machiene but not on my remote server. I have also tried to output any error messages to see if it would output anything, and I don't get anyting on my browser. Can anyone help me with this issue? Thanks <?php if($_SERVER['REQUEST_METHOD'] == "POST") { isset($_POST['interfax']) ? $option= "interfax" : $option= ""; isset($_POST['metrofax']) ? $option= "metrofax" : $option= ""; switch ($option) { case 'interfax': $file = "fax.php"; $fax_client = "interfax"; if(file_put_contents($file, "<?php ".'$fax_client = "' . $fax_client . '"'." ?>")) { echo "Successful"; } else { die("Can't write file"); } break; // By defualt all the orders go to metrofax so by selecting the variable it resets it self case 'metrofax': $file = "fax.php"; $fax_client = "metrofax"; file_put_contents($file, "<?php ".'$fax_client = "' . NULL . '"'." ?>"); break; } } ?> <form action="#" method="POST"> <input type="radio" name="interfax" value="interfax">Switch To Interfax<br> <input type="radio" name="metrofax" value="metrofax">Switch To Metrofax<br> <input type='submit' name="submit" > Ok, I know how to write to a file, but what I'm looking for is to check if a line of code exists, and if it is, don't recreate it. It would also be nice to not recreate the file either. Code: [Select] $file = fopen("index.html", "w"); fwrite($file,"This is a line of text"); fclose($file); I need help! I cant get this to write the correct way! What i need is based on the value of what is posted to the script it has to write it in the config file and also make a folder! Please help Code: [Select] <?php $start = '$uploadpath=\''; $structure = '../banner/images/'.$_POST['FOLDER'].'\';\n'; $myFile = "PHP/confup.php"; $fh = fopen($myFile, 'w') or die("can't open file"); $stringData = "<?\n"; fwrite($fh, $stringData); $stringData = "$start $structure"; fwrite($fh, $stringData); $stringData = "?>\n"; fwrite($fh, $stringData); fclose($fh); // Desired folder structure // To create the nested structure, the $recursive parameter // to mkdir() must be specified. if (!mkdir($structure, 0777, true)) { die('Failed to create folders...'); } // ... ?> I have a code for writing a log file... The code is working fine but it inserts the new details at the bottom of the file but i want to insert in the top... So what function should i use... Here is the file my_log.php Code: [Select] <?php $usname = $_SESSION['usname']; date_default_timezone_set('Asia/Calcutta'); $date = date("l dS \of F Y h:i:s A"); $file = "log.php"; $open = fopen($file, "a+"); fseek($open,289); fwrite($open "<b><br/>USER NAME:</b> ".$usname . "<br/>"); fwrite($open, "<b>Date & Time:</b> ".$date. "<br/>"); fwrite($open, "<b>What have they done :</b> ".$reason . "<br/><br/>"); fclose($open); ?> and here is my log.php file : Code: [Select] <?php session_start(); if($_SESSION['stage']!=1 || $_SESSION['stage2']!=2) {header('location:index.php'); die(" "); } ?> <?php if($_GET['valu']=="view_log") { $reason=" ".$_SESSION['usname']." Viewed the LOG"; include('my_log.php'); header('location:log.php'); die(""); } // bytes till here are 289 //LINE 1 : Log details have to insert here I want to insert every detail from the top of the page but just below the php code.. What should i do... ANy helo would be appreciated Pranshu Agrawal pranshu.a.11@gmail.com I'm writing a script that takes user input from a html form and updates the database with the new data. In this example the user is updating the data about the university they attend. The problem with this is, the script to update the database with the new information appears to be not working - the new data is not being added to the database. The SQL queries used in the script work in phpMyadmin, and the variables - $uni and $username - contain the data the correct data. This has me stumped, could someone look over this for me please and tell me what is going wrong here. Code: [Select] <?php include 'connect.php'; session_start(); $_SESSION['username']; if(!(isset($_SESSION['login']) && $_SESSION['login']!= " ")){ header("Location: login.php"); } $username = $_SESSION['username']; $tablename = 'usr_test'; $uni = $_POST['uni']; $uni = stripslashes($uni); $uni = mysql_real_escape_string($uni); $uni = trim($uni); if(isset($uni)) { $username = $_SESSION['username']; $loc = mysql_query("SELECT * FROM usr_test WHERE usr = '$username'"); if (mysql_num_rows($loc) == 0) header("Location:notlogged.php"); else { extract(mysql_fetch_array($loc)); mysql_query("UPDATE usr_test SET uni = ('$uni') WHERE usr = '$username'") or die (mysql_error()); header("Location:profile.php"); } } ?> I'm trying to write to a file with the following code. $fh = fopen("../inc/config.php", "a") or die("\r\nCan't open file."); $write = "\$config['database_host'] = {$mysqlh}; \$config['database_user'] = {$mysqlu}; \$config['datbase_pass'] = {$mysqlp}; \$config['datbase_name'] = {$dbn}; \$config['table_prefix'] = {$tp};"; fwrite($fh, $write); fclose($fh); It is printing out "Can't open file", which I guess means it can't find the file or I've given the wrong path. The file that is executing this code is /install and the file I'm trying to write to is /inc/config.php. I thought .. put you up a directory so if I do .. I will be at the root and then do /inc I will be in inc. Can someone please guide me on what I'm doing wrong? Thanks. Greetings, I am trying to write XML using SimpleXML for a web service call. I was having success until the XML got a little more complicated. Here is the XML format where I am running into problems: Code: [Select] <Agent> <Person Last='Smith' First='John'> <Addresses /> <PhoneNumbers> <Phone Type='1' Number='888-555-1212'> </PhoneNumbers> </Person> </Agent> Here is my php: Code: [Select] $xmlOutput = new SimpleXMLElement('<?xml version="1.0"?><ReportRequest> </ReportRequest>'); $xmlOutput->addAttribute('CID','9200'); $xmlOutput->addAttribute('Diagram','1'); $xmlOutput->addAttribute('DueDate','2011-11-15'); $xmlOutput->addAttribute('NumPhotos','6'); $xmlOutput->addAttribute('InspectAfter',''); $xmlOutput->addAttribute('PolicyNumber','JTC0004425'); $reportType = $xmlOutput->addChild('ReportType'); $reportType->addAttribute('CPType','Commercial'); $reportType->addAttribute('SectionIDs',''); $reportType->addAttribute('Description',''); $reportType->addAttribute('ReportTypeID','123'); $locations = $xmlOutput->addChild('Locations')->addChild('Addresses')->addChild('Address'); $locations->addAttribute('Zip','91216'); $locations->addAttribute('City','Chatsworth'); $locations->addAttribute('Line1','123 Main St'); $locations->addAttribute('Line2','Suite 201'); $locations->addAttribute('State','CA'); $locations->addAttribute('Latitude',''); $locations->addAttribute('Longitude',''); $agent = $xmlOutput->addChild('Agent')->addChild('Person')->addChild('Addresses')->addChild('PhoneNumbers')->addChild('Phone'); $agent->addAttribute('Last','Smith'); $agent->addAttribute('Email',''); $agent->addAttribute('First','John'); $agent->addAttribute('Title',''); $agent->addAttribute('Type','1'); $agent->addAttribute('Number','888-555-1212'); $agent->addAttribute('TypeName','Office'); $agent->addAttribute('Extension',''); Header('Content-type: text/xml'); echo $xmlOutput->asXML(); Everything outputs as it should until the line that starts with $agent. I want the output to match the section above. I have tried several variations but I cannot seem to figure it out. I know the current PHP sample doesn't work. Help?? Thanks in advance, John I have written some code to past information from one page to a diffrent page however all the variables are sent over but they are not writting to the database could anyone help me out please .... $ud_P_Id = $_POST['ud_P_Id']; $ud_LastName = $_POST['ud_LastName']; $ud_FirstName = $_POST['ud_FirstName']; $ud_GroupCode=$_POST['ud_GroupCode']; $ud_P_Unit1=$_POST['ud_P_Unit1']; $ud_P_Unit2=$_POST['ud_P_Unit2']; $ud_P_Unit3=$_POST['ud_P_Unit3']; $ud_P_Unit6=$_POST['ud_P_Unit6']; $ud_P_Unit14=$_POST['ud_P_Unit14']; $ud_P_Unit20=$_POST['ud_P_Unit20']; $ud_P_Unit27=$_POST['ud_P_Unit27']; $ud_P_Unit28=$_POST['ud_P_Unit28']; $ud_P_Unit42=$_POST['ud_P_Unit42']; $ud_P_Unit10=$_POST['ud_P_Unit10']; $ud_P_Unit11=$_POST['ud_P_Unit11']; $ud_P_Unit12=$_POST['ud_P_Unit12']; $ud_P_Unit13=$_POST['ud_P_Unit13']; $ud_P_Unit1454=$_POST['ud_P_Unit1454']; $ud_P_Unit15=$_POST['ud_P_Unit15']; $ud_P_Unit16=$_POST['ud_P_Unit16']; $ud_P_Unit17=$_POST['ud_P_Unit17']; $ud_P_Unit18=$_POST['ud_P_Unit18']; $con = mysql_connect('localhost', 'lccstude_progre', '********'); $db= "lccstude_pro"; if (! $con) die("Couldn't connect to MySQL"); mysql_select_db($db , $con) or die("Couldn't open $db: ".mysql_error()); mysql_query("UPDATE BTECL31113 SET FirstName='$ud_FirstName' , LastName='$ud_LastName' , GroupCode='$ud_GroupCode' , Unit1='$ud_P_Unit1' , Unit2='$ud_P_Unit2' , Unit3='$ud_P_Unit3' , Unit6='$ud_P_Unit6' , Unit14='$ud_P_Unit14' , Unit20='$ud_P_Unit20' , Unit27='$ud_P_Unit27' , Unit28='$ud_P_Unit28' , Unit42='$ud_P_Unit42' , Unit10='$ud_P_Unit10' , Unit11='$ud_P_Unit11' , Unit12='$ud_P_Unit12' , Unit13='$ud_P_Unit13' , Unit1454='$ud_P_Unit1454' , Unit15='$ud_P_Unit15' , Unit16= $ud_P_Unit16' , Unit17='$ud_P_Unit17' , Unit18='$ud_P_Unit18' WHERE P_Id='$ud_P_Id'"); echo "Record Updated"; mysql_close($con); Please any help would be great |