Jump to content
Larry Ullman's Book Forums

rob

Members
  • Posts

    143
  • Joined

  • Last visited

  • Days Won

    16

Posts posted by rob

  1. Edward, your comments don't make a lot of sense to me in the context of this:

     

    I want to create a general discussion thread about working with a database system from a programming standpoint. The thread is intended for discussing tools for abstracting the process of doing CRUD-operations against a database. I'm talking about Active Records, Wrapper Classes and Database Helpers.

     

    Can you expand on how you think ORMs, active records, wrapper classes, database helpers prevent quick and efficient development? Or how this is only relevant to high traffic websites?

     

    I'm also not following your point:

     

    Anyway no harm in your thread but we have to think more about the reality of the situation and what ideas are actually feasible for the present time.

     

    ... in the context of Antonio's statement above.

  2. You haven't actually stated what the issue/error is.

     

    You might be interested to know that I have broken the problem down to a simple query in another program for testing purposes such that $q = "SELECT id, size FROM sizes";

     

    That's not standard debugging if you think your issue is with the SQL: firstly you should print the query out in the browser to establish it is what you're expecting, then run the query directly against MySQL (using the CLI or other tool). If there are no issues with steps one and two, then inspect the construction of the html for the drop list.

  3. $emails = $wpdb->get_results( "SELECT email FROM emails WHERE zip_prefix = '$zip_prefix'" );
    foreach ($rows as $obj) {
    $email_array2[] = $obj->email;
    print_r($emails);
    print_r($email_array2);
    
    return $email_array2;
    

     

    I'm struggling to understand the code, does $emails turn into $rows at some point and that code is missing?

     

    Where's the closing curly bracket for the foreach loop? If it's after the return $email_array2, that could be affecting your loop.

     

    Is it possible to provide more of the script?

     

    You can return each row as an array (associative or numeric) by passing in a second parameter (output_type) to get_results:

     

    ARRAY_A

    ARRAY_N

     

    $wpdb->get_results('query', output_type);
    

     

    http://codex.wordpre...Generic_Results

     

    Which may be more helpful to you.

  4. These are the code files and you're not just copying and pasting source code from the pages viewed via the browser, right?

     

    There's nothing in the code you've provided that shows any of the basic php that you would need to process form data.

     

    Paul have you read Larry's book? Do you know how to write a form, send data to a php script, how to access and process that data via php?

     

    If you do, please provide this code.

  5. You've used the PHP solution which I provided inside of javascript. I assumed wrongly you were redirecting after server-side processing from the contact.php script.

     

    Build the functionality in PHP first, then build javascript on top of that.

     

    <form action="contact.php" method="post">
    <input type="text" name="first_name">
    
    $first_name = $_POST['first_name'];
    
    header('Location: success.php?first_name=' . $first_name);
    

     

    $first_name = $_GET['first_name'];
    
    echo 'Thank you ' . htmlentities( $first_name ) . ', your email was sent to us.';
    

     

     

    Also, as marguax has pointed out, you've provided few details of the whole process which has made it difficult to help.

  6. If you've made the videos you should already know your storage requirements. If not, you either have to make a test video and extrapolate based on it's file size; or make a guess based on average intended video length and MB/min.

    Bandwidth usage will be down to how popular/successful your service is. Stay clear of cheap hosting with unlimited bandwidth, it's never unlimited and the servers are usually loaded with as many sites as possible.

    Alternatively use a cloud service for video delivery; a sensible solution would be Amazon S3 http://aws.amazon.com/s3/ on top of regular hosting. Use S3 for video delivery and host your site with a regular hosting provider. Amazon charge on a usage basis and the charges are small.

    My best advice, know your requirements and do plenty of research.

×
×
  • Create New...