Jump to content

lucasl

Members
  • Posts

    21
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://www.freesoft.logical-host.com

Profile Information

  • Gender
    Not Telling
  • Location
    Melbourne, Australia

lucasl's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi! You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ” at line 1 I'm getting this error. I think it says line one because the code is being eval'd (using wordpress). I looked through and didn't find any problems with my querys. [code]<?php $do = true; $e_id = $_POST["ed_id"]; $e_name = $_POST["ed_name"]; $e_url = $_POST["ed_url"]; $e_description = $_POST["ed_description"]; if (empty($e_name)||empty($e_url)||empty($e_description)) { echo 'You didn\'t fill in all the fields, and the site was not edited. Please go back and try again.'; $do = false; } if ($do) { if (!get_magic_quotes_gpc()) { $e_name = stripslashes($e_name); $e_url = stripslashes($e_url); $e_description = stripslashes($e_description); $e_name = addslashes($e_name); $e_url = addslashes($e_url); $e_description = addslashes($e_description); } $dbhost = "localhost"; $dbusername = "freesoft_admin"; $dbuserpassword = ""; $dbname = "freesoft_freesearch"; $link = mysql_connect($dbhost, $dbusername, $dbuserpassword); if (!link) { echo mysql_error(); } else { if (!mysql_select_db($dbname)) { echo mysql_error(); } } $query = "UPDATE sites SET name = '$e_name', url = '$e_url', description = '$e_description' WHERE id = $e_id;"; $res = mysql_query($query); if (!$res) { echo mysql_error(); } mysql_close(); echo "The site was successfully edited."; $dbname = "freesoft_wordpress"; $link = mysql_connect($dbhost, $dbusername, $dbuserpassword); if (!link) { echo mysql_error(); } else { if (!mysql_select_db($dbname)) { echo mysql_error(); } } } ?>[/code] I'm using $do because it I exit or die, the rest of the wordpress page will stop.
  2. Hi! [code]<?php $error = 0; $backupFile = 'freesearch' . date("Y-m-d") . '.sql'; $command = "mysqldump --opt -h $dbhost -u $dbusername -p $dbpassword $dbname > $backupFile"; system($command, $error); echo "$error"; ?>[/code] This script should work fine, and $error returns 1, but for some reason, I can't find the sql file. (I looked in the folder the script is in, public_html and the root) Any ideas?
  3. lucasl

    Why Linux?

    Thats like saying, "Why is eating so popular?" Go here: [url=http://www.ubuntu.com/]http://www.ubuntu.com/[/url]
  4. I'm self taught at PHP, but originally I got a book on Blitz Basic for game programming. If you think about it, all languages are really the same at the core, with variables, ifs, whiles, etc. PS. Now I know Basic, C++(sorta), PHP, [url=http://www.gamemaker.nl]GML[/url], Actionscript, Python, (X)HTML, CSS. I think that's it...
  5. Post and get, I don't really know why. Its just the way I learn't.
  6. This probably won't work, but it can't hurt to try. Try using $_SERVER['PHP_SELF'] instead of its own filename. Also, don't use tables if you can help it. :)
  7. Sounds like you aren't putting "\n" between sections. EG. [code=php:0] //Instead of: <$php echo "$section1 $section2"; ?> Consider: <$php echo "$section1\n $section2"; ?>
  8. I used number_format, and it worked fine. Or did it? It keeps saying it loaded in 0.00005 or less seconds! Can somebody test it [url=http://www.freesoft.logical-host.com/]here[/url] (its at the bottom of the page)?
  9. Here's an interesting note, look at this: [code]Starttime Raw: 0.43816100, 1166334795 Fintime Raw: 0.43820800, 1166334795Page loaded in 5E-05 secs. fin: 1166334795.44 start: 1166334795.44[/code] Thats all the variables. Raw is the array result of millisecs seperated by a comma. I think something is wrong with my millisecs command EDIT: And by millisecs I mean microtime():)
  10. Mine is as well PS. I can't post for 20-50 mins
  11. I got 0 if I rounded it to 4 or less, and 3E-05 for 5. I haven't tried 6.
  12. Well, I don't know about the images, but I would of thought the easiest way would be to put the names/links in a mysql and write an html file with php fwrite().
  13. That didn't work, and I didn't think it would. The computer doesn't care what order I add things in, or what my variables are called. PS. Thanks for the <?php tip.
×
×
  • 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.