Jump to content

rawdata

Members
  • Posts

    9
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

rawdata's Achievements

Newbie

Newbie (1/5)

0

Reputation

1

Community Answers

  1. Nevermind, I was trying to use an apostrophe without escaping it.
  2. Can anyone see where I have erred? No errors of any kind. Here's the form: <form name="news" action="updateNews.php" method="post"> <p>Click "Clear" Button to remove old events.</p> <input type="submit" id='delete' name="delete" value='Clear' /><br /><br /><br /> <input type="text" name="dateof" /> Enter date of Event (abbreviate month)<br /> <input type="text" name="event" /> Enter name of Event<br /> <input type="text" name="title" /> Enter time of Event and misc. info.<br /><br /> <input type="submit" name="add" value="Add Event" /><br /><br /> </form> Here's my php: <?php error_reporting(E_ALL); ini_set('display_errors', 1); //Hook up include('db.php'); //Delete old news if(isset($_POST['delete'])){ $query = "TRUNCATE TABLE `news` "; $result = mysqli_query($link,$query) or die('Error deleting table.'); } if(isset($_POST['add'])){ //Get the goods $dateof = $_POST['dateof']; $event = $_POST['event']; $title = $_POST['title']; //Insert the goods $query = "INSERT INTO news (dateof, event, title) VALUES('$dateof', '$event', '$title')"; $result = mysqli_query($link, $query) or die('Update Failed' .mysqli_error($link)); } db.php is just my connection file: <?php /* Database Information - Required!! */ /* -- Configure the Variables Below --*/ $dbhost = 'localhost'; $dbusername = ''; $database = ''; $dbpasswd = ''; /* Let's get connected*/ $link = mysqli_connect("$dbhost", "$dbusername", "$dbpasswd", "$database"); /* Now check that we're connected */ if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); }
  3. Not really sure how to efficiently search for what I am looking for help with, so if this has been asked before, please accept my apologies. I have a program that virtual pilots use to report their flights with that uses php. Some of the flights these pilots report are called "maintenance" flights. The problem is, the program has no checkbox to show that it is a maint. flight. I need to know if there is a way to have the pilot enter the flight number with an "M" as the first character and then write a conditional that keys off of the first character no matter what follows.
  4. I guess I did leave that wide open huh? I didn't mean to say that there would be no instruction to do so at all. Rather, that the instruction would be run from within MySQL, thru phpmyadmin perhaps, and not from an outside script. Sometimes though my coding seems to make things happen that I didn't tell it to do. I usually find out later that I did indeed tell it to do it, but at the time, I didn't think I did. Thanks for your replies. rd
  5. Actually, what I mean is can I make MySQL copy a field from another field? For instance, I have a table in my db with one field named ID that auto-increments. I need it to put the same value into another field within the same table named cb_cid. Is it possible to do this without writing a script to make it do this?
  6. Is there some way in MySQL to make one field of a record copy its value to another field of a different name as the record is created?
  7. What I need to do is to look at each line in the text file, find the userid that an administrator inputs into a form, and delete that line so that a new line can be appended with updated info. Or, if anyone knows of an easier way to modify info on a certain line in a text file, I'm all ears. Please excuse my noobiness, I'm just having fun learning this stuff. Rawdata
  8. Thanx ober, I'll take another look around and see what might help me. Regards, rd
  9. Maybe I am missing something, but I don't see any tutorials on exchanging data between pages other than thru mysql.  After poking around a bit, I get the feeling that it is done thru http but I'm really not sure. I have looked on php.net but to me that is just a bunch of words with no real meaning.  Can anyone perhaps do a tute on this? Let me explain a bit more what I am looking for and perhaps it will be a little clearer what kind of tutorial I mean.  I am trying to make a one click installer for the membership system I built using phpfreak's tutorial.  I need to have the variables in a file for the connection file to draw from. Phpfreak, are you up to the task?  I know you are, and I hope you will do it.  Please? Regards, rd
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.