Jump to content

MCP

Members
  • Posts

    60
  • Joined

  • Last visited

    Never

Everything posted by MCP

  1. You would need the html form to be like this instead: [code] <form action='<?php echo $_SERVER['PHP_SELF']; ?>' method='post'>   <input type='text' name='name' size='40'>   <input type='submit' name='Submit' value='Search'> </form> [/code] and then for the query part, use this instead: [code] $result = mysql_query("select * from union_members where firstname+lastname like  '%".mysql_real_escape_string($_POST['name'])."%'") or die (mysql_error()); [/code] As listed, on the first run it should return everybody, but you can tweak that as desired.
  2. It seems kind of a waste to create an entire database just for a single table. If you're worried about security, create a separate ID (mixed mode authentication?), that only has the appropriate rights to the new table, and use that ID to connect to the database to save your users' new tutorials. So, I say just a new table, as there are no real security benefits to a separate database (assuming that's what you mean be safer?).
  3. I don't use this method myself, but you have to set mssql.secure_connection = On in the php.ini file. Or, you can turn on mixed mode authentication in SQL Server, and then go the username/password method.
  4. Group by is the best, but whatever works i suppose. Here's the SQL: select ingredients.name, sum(recipeMakeup.Qty) from ingredients, production, recipes, recipeMakeup where production.productionDate = '$today' AND recipes.recipeID = recipeMakeup.recipeID AND recipeMakeup.ingredientID = ingredients.ingredientID AND production.recipeID = recipes.recipeID GROUP BY ingredients.name ORDER BY ingredientName ASC; basically, anything else that you want to select that is not aggregated (i.e. sum, avg, etc.) needs to also be in the group by statement. good luck!
  5. try something like this: Main differences is it stores $item_name in an array so you keep track of all the profiles, not just the last one; as well as looking to open and read $dir\$file, instead of $file. [code]$dir = "uploads\\crew_files"; if (is_dir($dir)) { $dp = open($dir);     while ($item = readdir($dp)) {         if ($item != "." && $item != ".." ) {         $file[] = $item;         $item_name[] = strtok($item,'.');         }     }     if($pd) {     closedir($dp);     } } for ($i=0, $i<count($file); $i++ ) { $npart = $dir."\\".$file[$i];     if (is_file($npart)) {     $fp = fopen($npart, 'rb');         if( $line = fgetcsv($fp, 100, "\t")){         echo "<div id=\"crew">                 <table width=\"400px\">                 <tr><td rowspan=\"4\"><img src=\"upload/crew_pix/{$item_name[$i]}.jpeg\"></td>                 <td>$line[0]</td></tr>                 <tr><td>$line[1]</td></tr>                 <tr><td>$line[2]</td></tr>                 <tr><td>$line[3]</td></tr>                 </table>                 </div> ";         }     } } [/code] your html might be a bit wonky too..
  6. remove the ";" in front of the line extension=php_gd2.dll in php.ini Also, be sure your extension dir is set appropriately so it can find php_gd2.dll, which should be in the php extensions directory extension_dir = "c:\php\extensions" for example
  7. If your initial value is in PHP, you'll need to use something like: [code] <a href "nextPage.php?myValue=<?php echo urlencode($somevariable); ?>">Next Page</a> [/code]
  8. yes, but you'll have to write your own session handling functions for all session related options. See http://ca.php.net/manual/en/function.session-set-save-handler.php There's even an example there for file-based sessions which you might want to extend. You'll want to put your database update in the _close and/or _gc functions.
  9. Why don't you just use char(32)? I can't imagine that the 16 bytes you'd "lose" per row is that critical... If you want to use a field, as the other poster said, use binary(16), or image.
×
×
  • 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.