Jump to content

bubbasheeko

Members
  • Posts

    166
  • Joined

  • Last visited

    Never

Everything posted by bubbasheeko

  1. Let's see if there is any errors. Change this: mysql_query("INSERT INTO `addresses` (`sale_items`) VALUES ('$address')"); to: mysql_query("INSERT INTO `addresses` (`sale_items`) VALUES ('$address')") or mysql_error(); Let me know if there is an error.
  2. OMG I missed that! WHERE id='$id' is not used when you use INSERT INTO. It is used for UPDATE and DELETE. If you are intending to update the record then you would use: $sql = "UPDATE `template` SET `file` = {$file}, `file_ext` = {$file_ext}, `file_size` = {$file_size}, `file_data` = {$file_data}, `tarikh_kemaskini` = CURDATE() WHERE `id` = {$id}";
  3. Let's change the structure a bit. I don't think you require the {} around curdate(). $sql = "INSERT INTO `template` (`file`, `file_ext`, `file_size`, `file_data`, `tarikh_kemaskini`) "; $sql.= "VALUES ('{$file}', '{$file_ext}', '{$file_size}', '{$file_data}', CURDATE() WHERE id='$id')";
  4. I'm a fan of using quotes... $query = mysql_query("SELECT * FROM test WHERE id NOT IN (SELECT id FROM test1) AND LIMIT " . $VarCount . " ORDER BY datetime DESC ") or die(mysql_error()); And the people who have posted below are absolutely correct. Limit needs to be at the end....
  5. To clarify this a bit more. The Javascript will keep the clock up to date, but I need to use a NTP server to start it off. I am not aware of how to do this in Javascript, or if it could be provided by a script I already have in PHP.
  6. Try this, you missed a bracket: $sql = "INSERT INTO template (file,file_ext, file_size, file_data,tarikh_kemaskini) "; $sql.= "VALUES ("; $sql.= "'{$file}', '{$file_ext}', '{$file_size}', '{$file_data}','{CURDATE()}' WHERE id='$id')";
  7. Ya I got that too, I ran it locally. Maybe it is just PHP being picky. Try this: foreach ($matches[0] as $address): $dbx= mysql_connect("localhost", "root", ""); //include before any database implematation if (!$dbx) { die('Could not connect: ' . mysql_error()); } mysql_select_db("Craigslist", $dbx); mysql_query("INSERT INTO `addresses` (`sale_items`) VALUES ('$address')"); mysql_close($dbx); endforeach; I added some quotations to your query. Also, speaking of something simple...double check your table name is correct as well as the column name.
  8. Well, not really an array. My eyes are boggled from looking at this screen for too long. Replace this: foreach ($matches[0] as $address): $dbx= mysql_connect("localhost", "root", ""); //include before any database implematation if (!$dbx) { die('Could not connect: ' . mysql_error()); } mysql_SELECT_db("Craigslist", $dbx); mysql_Query("INSERT INTO addresses (sale_items) VALUES ('$address')"); mysql_close($dbx); endforeach; with this for testing: foreach ($matches[0] as $address): echo $address . "<br>"; //$dbx= mysql_connect("localhost", "root", ""); //include before any database implematation //if (!$dbx) //{ //die('Could not connect: ' . mysql_error()); //} //mysql_SELECT_db("Craigslist", $dbx); //mysql_Query("INSERT INTO addresses (sale_items) //VALUES ('$address')"); //mysql_close($dbx); endforeach; What I have provide will place the output to your screen. Let me know if you see anything.
  9. That's what I thought it was. You have to inputs in your form with the same name. For you quote textarea, rename it from "content" to "quote" and the textarea name for mood from "content" to "mood". <tr> <td valign=top>Quote:</td> <td><textarea name="content" cols='' style='width: 99%; border:1px solid black; height: 300px;'><? echo $rows['quote']; ?></textarea></td> </tr> <tr> <td valign=top>Current Mood:</td> <td><textarea name="content" cols='' style='width: 99%; border:1px solid black; height: 20px;'><? echo $rows['mood']; ?></textarea></td> </tr> Don't forget to update your form handler to reflect the new names.
  10. This really wouldn't be a rollover, but more of an image replace. I am not sure what is happening when you submit. You show a function being called, sub(). I don't see that in the code provided.
  11. If you print_r on the array do you see anything in there?
  12. Hi Kevin, This would be handled by .htaccess. # Enable mod_rewrite, start rewrite engine RewriteEngine On RewriteRule (.*)/$ index.php?id=$1 RewriteCond %{HTTP_HOST} !^(.*)\.mysite\.com$ [NC] RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=301,L]
  13. I see why. if ($_POST['editquote']){ $detail=$_POST['content']; if ($_POST['newmood']){ $detail=$_POST['content']; Shouldn't you be using another $_POST variable for $detail under newmood or editquote? Eitherway you are storing something where it doesn't belong.
  14. I am developing a time card app, but have run into an issue that I didn't think of when I started the project. I want to display a digital clock on the screen that auto increments. So this would be Javascript. However, the problem I didn't think of at the time I came up with the idea was where the Javascript would get the time. Javascript defaults to the time of the user's computer. Obviously for a timecard app I would not want the user changing the time on their computer to look like they were in on time. So, I then thought of just using their main computer to pull the time, but this system is accessible by each of the employees. Then it hit me. I could pull the time from a NTP server. Now, I know how to pull the time from the NTP server with PHP. What I don't know is how I can get Javascript to grab that time and start incrementing it so that it can be used when the 'punch' form is submitted. I already have a plan if the time can not be grabbed from the NTP server. If anybody could get me started or point me in the right direction that would be great!
  15. so is the grey box not appearing or is it the menu? Where is the menu supposed to show?
  16. $_SESSION['mycompany']; Have you "started the session" in this file? (ie. <?php session_start(); ?> )
  17. You are attaching them to the email, that is why you are seeing that happen. If you want it in the body of the image. No matter what the receiver will have to grab the image from the server. You can't just 'embed' it.
  18. How is it messing up your css? Do you have a screen shot or an example to show?
  19. Kind of..somewhat important. IE...you create a directory called settings and create a file call db.php. In the db.php file you will add the connection db stuff. You will then call it from the file you need it from with: <?php include('settings/db.php'); ?> It mainly keeps your code shorter so you don't have to keep adding the connection strings in each file, you simply need to call it.
  20. rhodesa is right, if you only use one = you are setting the variable and not comparing it to the desired variable contents. if($submissionFrom == "form1") elseif ($submissionFrom == "form2") elseif ($submissionFrom == "form3") That would explain why it won't go past the first one because when it checks the first if statement it will set $submissionFrom to "form1" which of couse will fail on all subsequent checks.
  21. It would set that field as NULL because regardless if something is 'technically' in there it will treat it as if it has been submitted with something in it. Try to check to see if it is empty rather than the variable being set. if (!empty($_FILES['imgupload'])) { //some file processing// }
  22. Hi DrTrans, Change your query to this: $query = "SELECT * FROM tester SORT BY tester DESC"; or it is ASC rather than DESC...kinda tired to think lol
  23. Hi! Not sure why you are using a row counter to complete your loop. You should be doing this:
  24. Thanks for that....I totally forgot about using htmlentities().
×
×
  • 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.