Jump to content


Staff Alumni
  • Posts

  • Joined

  • Last visited

  • Days Won


craygo last won the day on April 26 2013

craygo had the most liked content!

About craygo

  • Birthday 04/14/1970

Contact Methods

  • AIM
  • Website URL

Profile Information

  • Gender
  • Location
    Rhode Island

craygo's Achievements


Member (2/5)



  1. The <BR> is the start of the error code that php is sending out saying it cannot find the variable for the POST data. It is doing what it is suppose to do. If you have not sent any POST data you will get the error for every variable you are trying to echo out. The actual full error code would be something like this <br /> <b>Notice</b>: Undefined index: data in <b>c:\Inetpub\wwwroot\phpforum\prev7~.php</b> on line <b>13</b><br /> That's why you see the <br /> Ray
  2. I had this from one before, just change the query and the display fields <?php // Set initial group values $lastcat = ''; // Query database $sql = "SELECT * FROM ". $regID ." "; $sql .= "GROUP BY CATAGORY, ITEM"; $res = mysql_query($sql); $num_rows = mysql_num_rows($res); echo "<ul>\n"; $i=1; while ($rows = mysql_fetch_assoc($res)){ // Print Catagory if ($rows['CATAGORY'] != $lastcat) { if($i==1){ echo " <li>Catagory: ".$rows['CATAGORY']."\n"; echo " <ul>\n"; } else { echo " </ul>\n"; echo " </li>\n"; echo " <li>Catagory: ".$rows['CATAGORY']."\n"; echo " <ul>\n"; } } // print rows echo " <li>".$rows['ITEM']."</li>\n"; // Reset group values $lastcat = $rows['CATAGORY']; $i++; } echo " </li> </ul>"; ?> Ray
  3. Pretty much will do the same thing. Only difference is the organization. When you use a join you don't have to put the 2 fields joining the tables in the where section, so you can actually see what you are filtering out a little more easy. Now when you have a one to many join and you have data in one table and no data to link to in another table and you want to see EVERYTHING in the first table you would have to use a LEFT JOIN. If you try to use the second query above you will not get any rows for the ones that have no matching data in the second table. Ray
  4. You can also have mysql do it for you. $sql = "SELECT DATE_FORMAT(`datefield`, '%b-%d-%Y') AS `fdate` FROM `tablename`"; Now your formated date will be in the alias `fdate` Ray
  5. actually it looks like something in orders.php. May want to post some code for that.
  6. use a different variable index.php will be looking for id have gh.php look for id2 so index.php?id=gh&id2=PS2 so now index will load up gh and gh will load up PS2 Ray
  7. Thanks for the replies fellas. Kens worked great. Ray
  8. I have a table and I want to put a couple fields into an array. I would like to query the table with my parameters then fill the array the keys will be one field and the values will be another field. I tried this but it is not correct [code]<?php $accounts = array(); $sql = "SELECT * FROM tokayacct";   $res = mysql_query($sql) or die (mysql_error());     while($r=mysql_fetch_assoc($res)){ $accounts[0] = $r['account_num']; $accounts[1] = $r['meter_num']; } ?>[/code] thanks guys Ray
  9. I am trying to read a Visual Fox Pro dbf file. I have tried setting up an ODBC connection but nothing. I have also tried using the dbase_open and it says unable to open xxx.dbf file. Anyone have an idea on these. Thanks Ray
  10. well the concept would be this Can have a link or button to pass on the variable "printreport" [code]<a href="<?=$_SERVER['PHP_SELF']?>?printreport=yes">Click here for entire report</a>[/code] Then have this check on the page [code]<?php if(isset($_GET['printreport'])){ // query to select all records $sql = "select * FROM table"; } else { // query to select records by page $sql = "SELECT * FROM table LIMIT x, x"; ?>[/code] Ray
  11. would better off having a link to print entire report, that way they can still print just the page they want if nessasary. Post the code you are using now and i can insert the code for you. Ray
  12. craygo


    If you are using iis 6+ you have to allow php to run on the server otherwise you get nothing. open your IIS, click on your server and you should see "Web server Extensions" add a new extension and include php.exe and the dll file you wish to use. Than make sure you check off "allow" Let me know Ray
  13. yes option 2 would be correct. [code]$username = $_POST['username']; // assign username from form to $username $password = md5($_POST['password']); //get password from form and convert it and assign to $password $sql = "SELECT * FROM table_name WHERE username = '$username' AND password = '$password'";   $res = mysql_query($sql) or die (mysql_error());   $num_rows = mysql_num_rows($res); if($num_rows >0){ // continue code here } else { echo "NO SOUP FOR YOU"; }[/code] Ray
  14. You can't. That is why you use the md5 hash. Only thing you can do is compare the passwords. If someone losses there password it can only be reset NOT retrieved. Why would you want to convert it back anyway??? Ray
  • 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.