Jump to content

lazylodr

Members
  • Posts

    13
  • Joined

  • Last visited

    Never

About lazylodr

  • Birthday 05/17/1982

Contact Methods

  • Website URL
    http://lazylodr.blogspot.com

Profile Information

  • Gender
    Male

lazylodr's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. You can use a registry pattern, google it.
  2. lazylodr

    Largest ID

    While I don't think that what you are trying to accomplish is great, and tend to side Pikachu2000 ... If you really wanted to do this, you could use a "SELECT MAX(user_id) FROM users" to get the highest user id, but that's not necessarily the best thing to do (if you have a high traffic site with two users that sign up at the same time, they could both get the same id. It's not likely, but it could happen) The other thing you could do, if you are using an auto-increment id field on the table, is perform the insert and get the auto-increment value, and then update the username on the record to the first name + id. This is a better solution that using the MAX query, the drawback being an additional update query. If you are using Oracle as your database, this is easy to do with a sequence. Simple query the nextval from the sequence (SELECT user_seq.nextval FROM dual;) and use that value for both your primary key, and the concatenation with the first name when you perform the insert.
  3. Wow, you're trying to do a lot in one line...whenever I get these types of errors on one-line-wonders that I try, I usually break it down to see which function is returning a non-obect: $nav = $this->navigation(); $menu = $nav->menu(); $menu->setAcl($obj_menuacl); $storage = $_auth->getStorage(); $read = $storage->read(); $uid = $read->uid; $menu->setRole($uid); Use this to figure out which line is returning the non-object. Once you figure out where it is, you can reconstruct it back to the way you had it (after you fix the bad object) if you'd like.
  4. Did you mean: $query_bf=mysql_query (" SELECT * FROM bf WHERE location IN ('England', 'Japan', 'Colombia', 'USA', 'Russia', 'Italy', 'Turkey') AND owner = '$username' ");
  5. I believe an include will execute the script as well within the context of the including script (and you can even have a return value from the script that you included)
  6. Do you have a different <input> tag in your form with the name "id"? Also, I wonder why you are checking for $_GET['id'] when your form's method is clearly post? Try print_r($_POST); on a submission and see what comes back.
  7. All you are doing here is assigning the value "<input name='quantity' type='text' id='quantity' size='3' maxlength='3'>" to the variable $quantity in PHP on the server. This has nothing to do with data from a user. If you want data from a user, you must use forms and their submitted values (using $_GET, $_POST variables depending on the form's method attribute) from the request as outlined above. The <input type="submit" /> renders a submit button on the form so the user can send the data back to the server.
  8. This might help you out http://www.brandonsavage.net/an-intro-to-zend_navigation/
  9. If you are trying to prevent duplicate form code then I agree with AbraCadaver, sessions will not help you here. His suggestion is spot on. I only wanted to add that Zend_Form in the Zend Framework, specifically the populate method, can also help you achieve what you are looking for.
  10. More specifically prepared statements and parameter binding will help
  11. Yeah, that seems to make sense. I would separate each grid into it's own view script and use partials the first page load. For the ajax actions, I would use the viewRenderer to render the individual grid view scripts, and you'll probably want to disable the layout, if you're using one. Also it would be important that whatever is getting the data for the grids is in a reusable model so you can consistently get the results you need either context (first page load or ajax). If you do all of this: the logic to get the data for the grids is only done once, the views for each grid is only done once, the "first page" is only done once, and your controller just manages these components. In MVC it's important to keep the controllers skinny ... that will naturally promote the most code re-usability.
  12. Another problem you may be having is that the column "id" isn't in the list of columns you said were in the table...if you are trying to delete a specific index try $sql = "DELETE FROM FORUM_MESSAGE WHERE index='$del_id'";
  13. Have you considered ODBC as an option? (http://php.net/manual/en/ref.pdo-odbc.php) Not sure if you have something like unixODBC already installed (http://www.unixodbc.org/) ... if not, maybe you could talk to your administrator? Although getting that going isn't an simple task either. I hate to mention it, but is there any possibility of deploying on a Windows box?
×
×
  • 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.