Jump to content

daydreamer

Members
  • Posts

    203
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

daydreamer's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. That page is helpful, i am aware of __LINE__, but the problem is I would need to know the line number where the function was called without passing __LINE__ as a argument. e.g. function mysql_query(){//override mysql_query mysql_query()or error_function(error_code,error_string,line_number); } mysql_query(); //<<< need to log this line number
  2. I am currently using my own error handler so i can log all mysql errors into a mysql table: mysql_query('select data from table')or trigger_error(mysql_error(),256); If there's an error i need to know the line number where the mysql_query function was called. Is it possible to instead use this code: mysql_query('select data from table'); but somehow transparently log a mysql error and the line number if there is an error in the query? thanks
  3. categories would be good, but i have to many products to manually sort... used sphinx search server in the end
  4. similar items, so if a user is viewing one item i can suggest similar items to compare
  5. I have a database table of product titles. For each product, I want to link 10-20 similar products, ordered by relevance. For example: db.products IDTitle 1White Paint, Quick Dry 2Yellow light bulb >50000.... db.product_similarity IDPIDsimular_to_PIDrank 11221 213222 Anybody have any suggestions about how I could go about this? The main concern is quality/relevance and accuracy. thanks.
  6. This maybe useful: http://www.askapache.com/htaccess/sending-post-form-data-with-php-curl.html Try this: 1. install live http headers firefox plugin. 2. login with your browser. 3. view the initial first post, and see the post contents. It will be in this format: username=yourusername&password=yourpassword&otherstuff...... 4. the above post is what you need to replicate with your PHP script using cURL. 5. Login with cURL (enable cURL cookies) using PHP, then try to download the file you are after. It should work as you now have authenticated yourself to the server you are downloading from.
  7. I agree and prefer to use mysql_real_escape_string, but a site I am working on has their own escape function, that also replaces ' and " so that if data is taken out, processed in some way and then put back into a table (if it contained a ') it will not have to be escaped again. I just wondered how secure it is.
  8. Is not using mysql_real_escape_string before putting strings into a mysql query a security problem if you apply the following steps before: 1. take out all ' and ". 2. apply stripslashes(); 3. apply http://uk2.php.net/manual/en/function.addslashes.php 4. put the string between apostrophes: insert into table set column='user entered string' Thanks any opinions appreciated
  9. Code 4 detailspage.php: $user_id=mysql_real_escape_string($_GET['user_id']); $userinfo=mysql_query(SELECT * FROM users WHERE id=$user_id)
  10. http://www.sphinxsearch.com/ is good if your on a linux server and can install stuff. its much faster than like apparently. I have set it up its quite easy to do.
  11. use curly braces: <?php while(..){ if(...){ }else{ } } ?> Although I would recommend learning how to pull just the data you need using the mysql query, using a WHERE clause.
  12. <h1 id=unique>kdjkjd dwekjnd wk</h1> <div> match any whole sentences between the h1 and script tags only </div> <script> How would I match the whole sentences in this scenario? I am having trouble writing a reg ex for 'match from h1 to script tag'. This will match data between the tags, but it includes line breaks (which I dont need): >[^<]*\b([\s0-9a-zA-Z]+)[^<]*< Cheers
×
×
  • 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.