Jump to content

fou2enve

Members
  • Posts

    21
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

fou2enve's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. $stmt = $dbconn->prepare("SELECT * FROM `?_table` WHERE `name`='?'"); $stmt->bind_param('ss', $city, $name); Fatal error: Call to a member function bind_param() on a non-object in C:\htdocs\beta\process.php on line 122 ive run the query in phpmyadmin and it works without errors, ive read online that if the query fails then $stmt becomes null and then bind_param fails. but the variables are valid when i echo them, so im lost. any ideas?
  2. ive also done this, by using the date and a flat file, if the date didn't match the flat file date, then it was a new day, the query would run, and the flat file updated. cron works, but this is just an alternative.
  3. $stmt = $dbconn->prepare("SELECT * FROM `?_table` WHERE `name`='?'"); $stmt->bind_param('ss', $city, $name); Fatal error: Call to a member function bind_param() on a non-object in C:\htdocs\beta\process.php on line 122 ive run the query in phpmyadmin and it works without errors, ive read online that if the query fails then $stmt becomes null and then bind_param fails. but the variables are valid when i echo them, so im lost. any ideas?
  4. okay so im new to using mysqli, so im using basically the php example online to get it working. but i get a funky error: Fatal error: Call to a member function fetch_field() on a non-object in C:\htdocs\index.php on line 218 ive bolded line 218 bellow. any ideas as to what im doing wrong? thanks _KN $stmt = $mysqli->prepare("SELECT id, name FROM friends"); $stmt->execute(); /* get resultset for metadata */ $result = $stmt->result_metadata(); /* retrieve field information from metadata result set */ [b]$field = $result->fetch_field();[/b] printf("Fieldname: %s\n", $field->name); /* close resultset */ $result->close(); /* close connection */ $mysqli->close();
  5. okay let me re-word this, to make things clearer. theres a couple columns, one is `area`, another `aspect` and another `attraction` as an example in literal terms: mql, find $input in the column `aspect` and $input2 in the column `attraction` but limit yourself to rows that have 'san fransisco' as your `area` i can deal with it if i can only search for only one of the $inputs but i need sql to do this
  6. fou2enve

    cache system

    you can also use ADODB to help with caching and it makes it easier to port the db if you ever need to.
  7. Okay heres the story, I'm developing this search application. Theres a couple issues i am running into; 1. I want to search for specific text within a table. - Figgured that out with full text and the Match function. 2. Nows heres where it gets goofy, i want the match funtion to only search rows that has $input_name (a posted value from user) in the field `name` So I think im looking for a sql query that will allow me to use match but selectively, Is this even possible?? Is there a better way to do this? thanks for the help!
  8. awesome. glad you figured it out.
  9. the only way to do that would be to limit the number of sql queries a specific IP can make, but in the process of doing that you may actually interfere with a normal user. Especially in the scenario where 1000 people share an outside IP, such as a corporation or AOL or something like that.
  10. are you looking for an instantaneous search? or like something at X interval? because what you may be able to do, is set up a cron job and have it run the query and output to a text file. Then have php find the username and based on what line number in the text file the username appears that would be their rank. I'm not sure how exactly to do this but in theory it sounds like it could work, the only thing would be figguring out what line number your on, the rest i know is possible. you might even be able to just have php count it, if its not something that fopen supports, or their may be some wrappers that may support that. from php.net/file <?php // Get a file into an array. In this example we'll go through HTTP to get // the HTML source of a URL. $lines = file('http://www.example.com/'); // Loop through our array, show HTML source as HTML source; and line numbers too. foreach ($lines as $line_num => $line) { echo "Line #<b>{$line_num}</b> : " . htmlspecialchars($line) . "<br />\n"; } // Another example, let's get a web page into a string. See also file_get_contents(). $html = implode('', file('http://www.example.com/')); ?>
  11. i agree with corbin thats prob the only way to do it
  12. ive done this a couple time with a couple sites, as long as the redirect is a permanent redirect (403 i think the code is) then google sees the new php as a replacement for old ones
  13. I have a login page that posts to itself along with a url attached (ie login.php?url=protectedpage.php?ID=9230&B=4949 ). the problem I'm having is getting anything after the & to stick. Here's what i mean: if (isset($_POST['name']) || isset($_POST['pass'])) { // form submitted // check for required values if (empty($_POST['name'])) { die ("ERROR: Please enter username!"); } if (empty($_POST['pass'])) { die ("ERROR: Please enter password!"); } if ($password="password") { // if a row was returned // authentication was successful // create session and set cookie with username session_start(); $_SESSION['auth'] = 1; setcookie("username", $_POST['name'], time()+(60*5)); echo "Access granted!"; $url = (isset($_GET['url'])) ? "$_GET['url']" :'index.php'; echo "<meta http-equiv=".'"'.'refresh'.'"'.' content="'."12;url=$url".'">'; echo $url; } else { // no result // authentication failed echo "ERROR: Incorrect username or password!"; } } else { // no submission // display login form ?> <html> <head></head> <body> <center> <form method="post" action="login.php?url=<? echo $url; ?>"> Username <input type="text" name="name" value="AuthorizedUser"> <p /> Password <input type="password" name="pass"> <p /> <input type="submit" name="submit" value="Log In"> </center> </body> </html> <?php } ?> im using $url=$_GET['url']; to get the URL and then later on in the script echoing $url into a meta refresh after a successful auth (actual auth process uses mysql but i pulled that out for now) but when the outputs i get: protectedpage.php?ID=9230 nothing else. I've tried using %26 in the initial url but that didnt help. I tried suing str_replace to try and replace & with %26 right before it outputted, but that didn't work. :-\ ideas?
×
×
  • 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.