Jump to content

bubbasheeko

Members
  • Posts

    166
  • Joined

  • Last visited

    Never

About bubbasheeko

  • Birthday 09/19/1977

Contact Methods

  • Website URL
    http://support.kdmp.ca/link.php?id=3

Profile Information

  • Gender
    Male
  • Location
    Ontario, Canada

bubbasheeko's Achievements

Newbie

Newbie (1/5)

0

Reputation

  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!
×
×
  • 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.