Jump to content

anon

Members
  • Posts

    134
  • Joined

  • Last visited

    Never

Everything posted by anon

  1. So would i use mysql_query("insert into Index, values ($page)"); ?
  2. I'm using myISAM with MySql. I have a database and I want to write the string to the database. so file_put_contents isn't suitable. Should I use a MySQL query?
  3. Hi, i want to know how i can write a string called $page into a database table. file_put_contents ?
  4. the password can't be wrong though. I have re-tried again and again. What is the Grant's table? Like the permission to change stuff? I checked all permissions. Is there some way I can check if I can access my database through the standard MySQL format?
  5. Hi, I have a problem. In Cpanel I have added a user to a specific database. When the code tries to connect to the database, it gives me this problem Problem selecting the database Direx Access denied for user 'redzero'@'localhost' to database 'Direx' Version - 4.1.22 - Standard
  6. Problem selecting the database Direx<br>Access denied for user '*******'@'localhost' to database 'Direx'
  7. The problem is in my password or something, because it says access denied.
  8. Ok, I'll try that now. Just asking, is that a technique used by developers to find where the problem is?
  9. Nope, no luck Here's my code at the mo <?php $dbhost = 'localhost'; $dbuser = '***'; $dbpass = '****'; $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error with database'); $dbname = 'Direx'; mysql_select_db($dbname); $getlist=mysql_query("SELECT u_link FROM addurl") or die("Query error ".mysql_error()); while($row=mysql_fetch_array($getlist)){ $text = file_get_contents($row[0]); mysql_query("insert into Index (content) values ($text)"); } ?>
  10. I think I may have spelt the DB name wrong. Is it case-sensitive?
  11. This is the error the Cron Daemon gave me\ "Query error No database selected" I did select a database though...
  12. I will try it, but the error is in line 13...
  13. Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/***/public_html/***/spider.php on line 13 Here is my current code - <?php $dbhost = '***'; $dbuser = '****'; $dbpass = '*****'; $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error with database'); $dbname = '****'; mysql_select_db($dbname); $getlist=mysql_query("SELECT u_id FROM addurl"); while($row=mysql_fetch_array($getlist)){ $text = file_get_contents($row[0]); mysql_query("insert into *** (content) values ($text)"); } ?> The code should fetch and index a page that has been specified in a database.
  14. The cron daemon gave me this error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/****/public_html/****/******.php on line 13
  15. I want to run it as a daemon. Could i stop it when I' done?
  16. So if you were to look at my code, this is what it does: takes a url from the table "addurl" gets the content of the page (the HTML code) saves this HTML to a database.
  17. Hi, i have a field in my table called "content". It is TEXT. thing is, how do i get it so that the amount of characters it asks you to specify is unlimited? Using phpMyadmin.
  18. Would this also work? <?php $dbhost = '*****'; $dbuser = '*****'; $dbpass = '*****'; $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error with database'); $dbname = 'url'; mysql_select_db($dbname); $getlist=mysql_query("SELECT u_id FROM addurl"); $save_location=mysql_query("INSERT INTO addurl"); while($row=mysql_fetch_array($getlist)){ $text = file_get_contents($row[0]); file_put_contents($save_location, $row[0]); }
  19. So what would this look like. Where would i add it in the code?
  20. Not trying to be irritating, but shouldn't this be in the regex section? I understand that you probably get more exposure in here, but still.
  21. I want to save it to a database table.
  22. Hi, my code looks like this <?php $dbhost = '*****'; $dbuser = '*****'; $dbpass = '*****'; $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error with database'); $dbname = 'url'; mysql_select_db($dbname); $getlist=mysql_query("SELECT u_id FROM addurl"); while($row=mysql_fetch_array($getlist)){ $text = file_get_contents($row[0]); file_put_contents($save_location, $row[0]); } ?> As you can see, i need to define $save_location. Thing is, how would i give the code a place to save to?
  23. <?php $dbhost = 'localhost'; $dbuser = 'root'; $dbpass = 'password'; $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql'); $dbname = 'url'; mysql_select_db($dbname); //would i still need to connect to table? $getlist=mysql_query("SELECT url FROM url_table"); while($row=mysql_fetch_array($getlist)){ $text = file_get_contents($row[0]); file_put_contents($save_location, $row[0]); } ?> Would this work
  24. so at the top i would mysql_connect then put the code. But i would have to specify "$save_location" Would this just be insert into database + table of choice?
  25. This is a basic snippet for getting data from a web page (right?) $text = file_get_contents($url); file_put_contents($save_location, $text); Could i make $url a function? As in $url= "this will change as I go through a list of URL's in a database, then apply the file_get_contents?" (i'm a fat n00b) Then obviously $save_location would be the database I want to save it to?
×
×
  • 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.