Jump to content

dgiberson

Members
  • Posts

    87
  • Joined

  • Last visited

    Never

Everything posted by dgiberson

  1. i take it your trying to call a function from test2.php?
  2. try using the html <table><tr><td></td></tr></table> setup, should fix it up for ya...
  3. you mean like creating a mysql table or mysql schema from php?
  4. SauloA, I think for what you are trying to accomplish, a timestamp field is the way you want to go if you want the date/time updated every time the record is touched.... otherwise use an integer(11) field to store unix timestamp, and update that from the php code. i cant find any documentation on setting a default time value without using a timestamp data type...
  5. good stuff, glad to help.... i really suggest creating your queries in phpMyAdmin or MySQL Query Browser first, cause it will return you a little more info versus running it in your php code, the standard not a valid argument error doesn't really help you troubleshoot the query. Then porting it to php becomes a snap
  6. I don't see any php code there.... just a javascript include PS. get rid of these lines: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">
  7. If there's not a whole lot of data in the table, I would suggest scrapping the table and start from the beginning, if there is a bunch of data, I can check phpMyAdmin once I get home...
  8. the lesson that can be learned from this thread is plain & simple..... build your query in Query Browser / phpMyAdmin, once it's working then copy it into PHP and make the appropriate variable alterations.... saves many many hours of frustration
  9. is the extension of the file .php .... depending on the server/browser used, sometimes the code will function properly in another file extension ie. .html
  10. [quote author=seb213 link=topic=123868.msg512575#msg512575 date=1169668922] this is what i get if i run the query in sql [quote]Error SQL-query : $pid = $_REQUEST['products_id'] MySQL said: 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 '$pid = $_REQUEST['products_id']' at line 1[/quote] [/quote] is that in phpMyAdmin??? take out $pid and change it to a valid product_id
  11. try taking the NOT NULL option off.... that might work, i know it does in Query Browser
  12. does that query run in Query Browser or phpMyAdmin ???? I know the syntax of what I wrote is right, could be that the $_REQUEST['varname] is wrong......
  13. change to: CREATE TABLE `user_review_tbl` (   `urev_id` int(11) NOT NULL auto_increment,   `user_id` int(11) NOT NULL,   `urev_review` text NOT NULL,   `urev_date` datetime NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,   `urev_approved` tinyint(1) default NULL,   `shop_id` int(11) NOT NULL,   PRIMARY KEY  (`urev_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;
  14. Try this..... [code] $pid = $_REQUEST['products_id']; $query_Recordset2 = "SELECT * FROM products_to_categories ptc INNER JOIN  products_description pd ON ptc.products_id = pd.products_id INNER JOIN products p ON p.products_id = ptc.products_id WHERE ptc.categories_id = $pid"; [/code]
  15. [quote author=realjumper link=topic=123753.msg512554#msg512554 date=1169667329] dgiberson: The tables are setup as MyISAM [/quote] I take it this page is hit a lot? One possible explanation for the slow page load could be because if this db is taking in a lot of hits, MyISAM is a table locking format meaning that it will not process a request until the previous requests touching that table are complete (even if its only processing 1 record). I would suggest switching over to a row locking table type ie. InnoDB which could speed this up a bit. Secondarily, I would also check to see what you have the query cache set to on the server if it's setup at all. If you crank the cache up this should also assist in speeding up the returns.
  16. [quote author=boo_lolly link=topic=123753.msg512552#msg512552 date=1169667162] where's the u.column_name coming from? another query? << no he defined an alias for the table users u [/quote]
  17. what kind of table type are the tables setup as? InnoDB, MyISAM?
  18. You could use a regular expression to do this....
  19. Most likely there is an issue with the query, echo $sql and try to run it in Query Browser/php MyAdmin whatever you use and see if it returns a recordset or not.
  20. You could do a string replace... Is this so the data will insert into a db? if so you can just do $var = addslashes($var); and it will insert no problem
  21. If the programmer is going to be canned, why not just change the username/password?
  22. or you can change where you are using echo " <whatever > "; to echo ' <whatever here > <whatever on a new line in the editor> <something else>';
  23. simcoweb, how are you storing the best days information tho.... Do you want to submit a comma separated list? or insert multiple records into the table for each of the days they select? If you want to enter multiple records just use: mysql_connect($dbhost, $dbuser, $dbpass) or die(mysql_error());   mysql_select_db($dbname) or die(mysql_error()); or($i=0;$i<count($best_days);$i++) {   $sql = "INSERT INTO schedule VALUES           ('', '$name', '$email', '$phone', '$appt_for', '$best_days[$i]', '$best_time', '$message', '$date')";   $results = mysql_query($sql) or die("Error occurred: ".mysql_error()); } For a comma separated list use your existing query (change the var $best_days to $bestdays) , but before that do this: for ($i=0;$i<count($best_days);$i++) {   $bestdays .= $best_days[$i].","; } $len = strlen($bestdays) - 1; $bestdays = substr($bestdays,0,$len);
  24. realjumper, I had the same issue with a corporate product, the only way I have ever found to effectively handle it was the solution I came up with, take it for what it's worth but in combination with my system's access logs, I've never had an issue, I can track people down to login locations, request pages, querystring information, date/time, records they affected, you name it..... Had to do it in order to get SOX compliance.
  25. You could load all the file names into an array, then sort the array....
×
×
  • 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.