Jump to content

jdimino

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jdimino's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi Everyone Hope someone can help me, I would like to know how to make the following links work in this script. <a href="http://Mysite/SEArchive/approve.php?id=' . $row['id'] . '">Approve</a> <a href="http://Mysite/SEArchive/deny.php?id=' . $row['id'] . '">Deny</a> <?PHP function alert($alert) { $out .='<script type="text/javascript"> alert("'.$alert.'"); </script> '; print $out; } $imgpath="http://Mysite/SEArchive/"; mysql_connect("localhost", "xxxx_xxxx", "xxxx") or die(mysql_error()); mysql_select_db("xxxx_xx") or die(mysql_error()); $sql = "SELECT * FROM `ihsreg` WHERE approve!='TRUE' ORDER BY `Bloom_Name` ASC"; $results = mysql_query($sql); $column = 1; echo "<table>"; while(($row = mysql_fetch_assoc($results)) !== false) { $bloom=trim(ucwords($row['Bloom_Name'])); $id=trim(ucwords($row['id'])); $path=substr($bloom,0,1)."/"; if ($column == 1) { print "<tr>"; } echo ' <td> <a href="http://Mysite/SEArchive/RegPending1.php?search=' . $row['Bloom_Name'] . '"> <img src="'.$imgpath.$path.$bloom.'.jpg" width="130" height="130" border="0"> <BR></a>' .$bloom.'</td>';<BR> <a href="http://Mysite/SEArchive/approve.php?id=' . $row['id'] . '">Approve</a> <a href="http://Mysite/SEArchive/deny.php?id=' . $row['id'] . '">Deny</a> if ($column == 6) { echo "</tr>"; $column = 0; } $column++; } if ($column < 5) { while ($column < 5) { $column++; echo " <td> </td>"; } echo "</tr>"; } echo "</table>"; ?>
  2. Hello Need to write a program that will search all files in a directory/sub directories (SEArchive/a-z) in mysql database and echo the image. probably some sort of a loop code? can somone tell me what needs to be changed to make it wotk <?PHP $link = mysql_connect('localhost', 'XXXX_jdimino', 'XXXX'); if (!$link) { die('Could not connect: ' . mysql_error()); } mysql_select_db('XXXXXX'); // Fetch total number of records $result = mysql_query("SELECT COUNT(*) AS recordCount FROM ihsreg"); $row = mysql_fetch_assoc($result); $recordCount = $row['recordCount']; // Perform Search $results = array(); if(isset($_REQUEST['search'])){ $limit = 20; if($_GET['offset']){ $offset = $_GET['offset']; } else { $offset = 0; } $SQL = "SELECT * FROM ihsreg "; //$term = strtoupper(addslashes($_REQUEST['search'])); $term = strtoupper($_REQUEST['search']); if(stristr($term,"'") && !stristr($term,"\'")){ $term = addslashes($term); } if($_REQUEST['radiobutton']){ switch($_REQUEST['radiobutton']){ case '1': $SQL.=" WHERE Bloom_Name LIKE \"$term\""; break; case '2': $SQL.=" WHERE Pod_Name LIKE \"$term\""; break; case '3': $SQL.=" WHERE Pollen_Name LIKE \"$term\""; break; case '4': $SQL.=" WHERE Hybridiser LIKE \"$term\""; break; case '5': $SQL.=" WHERE Origin LIKE \"$term\""; break; case '6': $SQL.=" WHERE Grower LIKE \"$term\""; break; case '7': $SQL.=" WHERE Color_Group LIKE \"$term\""; break; case '8': $SQL.=" WHERE Bloom_Type LIKE \"$term\""; break; case '9': $SQL.=" WHERE Reg_Mini LIKE \"$term\""; break; case '10': $SQL.=" WHERE Size_Range LIKE \"$term\""; break; case '11': $SQL.=" WHERE Propagation LIKE \"$term\""; break; case '12': $SQL.=" WHERE Bloom_Color LIKE \"$term\""; break; case '13': $SQL.=" WHERE Bloom_Characteristics LIKE \"$term\""; break; case '14': $SQL.=" WHERE Leaf_Characteristics LIKE \"$term\""; break; case '15': $SQL.=" WHERE Bush_Characteristics LIKE \"$term\""; break; case '24': $SQL.=" WHERE Cross_Made LIKE \"$term\""; break; case '25': $SQL.=" WHERE date LIKE \"$term\""; break; default: $SQL.=" WHERE Bloom_Name LIKE \"$term\""; break; } // switch } else { // If they didnt' select a radio button... $SQL.=" WHERE Bloom_Name LIKE \"$term\""; } $result = mysql_query($SQL); $resultCount = mysql_num_rows($result); $SQL.= " LIMIT $offset, $limit"; $result = mysql_query($SQL); if($resultCount > 0){ while($row = mysql_fetch_assoc($result)){ $results[$row['id']] = $row; } // while } // if there are results } // if user performed a search ?> <HTML> <HEAD> <META HTTP-EQUIV="Content-Type" CONTENT="text/html"> <script type="text/javascript">
  3. Hi Everyone I'm getting a parse error, can someone help? Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home1/internb7/public_html/SEindex2.php on line 34 <?php $breakstring=''; $link = mysql_connect('localhost', 'xxxx_jxxxx', 'jxxxx'); if (!$link) { die('Could not connect: ' . mysql_error()); } mysql_select_db('xxxxx'); // Fetch total number of records $result = mysql_query("SELECT COUNT(*) AS recordCount FROM ihsreg"); $row = mysql_fetch_assoc($result); $recordCount = $row['recordCount']; // Perform Search $results = array(); if(isset($_REQUEST['search'])){ $limit = 20; if($_GET['offset']){ $offset = $_GET['offset']; } else { $offset = 0; } $SQL = "SELECT * FROM ihsreg "; //$term = strtoupper(addslashes($_REQUEST['search'])); $term = strtoupper($_REQUEST['search']); if(stristr($term,"'") && !stristr($term,"\'")){ $term = addslashes($term); } if($_REQUEST['radiobutton']){ $fields=array(1 => "Bloom_Name", 2 => "Pod_Name", 3 => "Pollen_Name", 4 => "Hybridiser", 5 => "Origin", 6 => "Grower", 7 => "Color_Group", 8 => "Bloom_Type", 9 => "Reg_Mini", 10 => "Size_Range", 11 => "Propagation", 12 => "Bloom_Color", 13 => "Bloom_Characteristics", 14 => "Leaf_Characteristics", 15 => "Bush_Characteristics", 16 => "Cross_Made", 24 => "date", 25 => "Bloom_Name"); $SQL.=" WHERE \"$fields[(int)$_REQUEST['radiobutton']]\" LIKE \"$term\""; break; } else { // If they didnt' select a radio button... $SQL.=" WHERE Bloom_Name LIKE \"$term\""; } $result = mysql_query($SQL); $resultCount = mysql_num_rows($result); $SQL.= " LIMIT $offset, $limit"; $result = mysql_query($SQL); if($resultCount > 0){ while($row = mysql_fetch_assoc($result)){ // What does the line below do // $results[$row['id']] = $row; if($row['approve'] == false) {$breakstring='Registration Pending';break;} } // while } else { $breakstring='The Name not Registered you may use this name to Register a new Cultivar'; } // if there are results } // if user performed a search if(!empty($breakstring)) { echo $breakstring; // do what ever } else { // do whatever else } ?>
  4. Hi everyone, I hope someone can help me, I’m not that good with php, but I often find very generous people in this group willing to give me a hand. I will try my best to explain how the script should work. I would like to use one of mysql database field ("approve") and have it validated by using using a true or false statement. When the script is searching mysql database and finds the field approve as false it should give me give me the following message “Registration Pending” and end the script, if no search string found the following message “The Name not Registered you may use this name to Register a new Cultivar” and end script The field (approve) defaults to false if it finds the field true, then it should display all data. please help me <?PHP $link = mysql_connect('localhost', 'xxxx_jxxxx', 'jxxxx'); if (!$link) { die('Could not connect: ' . mysql_error()); } mysql_select_db('xxxxx'); // Fetch total number of records $result = mysql_query("SELECT COUNT(*) AS recordCount FROM ihsreg"); $row = mysql_fetch_assoc($result); $recordCount = $row['recordCount']; // Perform Search $results = array(); if(isset($_REQUEST['search'])){ $limit = 20; if($_GET['offset']){ $offset = $_GET['offset']; } else { $offset = 0; } $SQL = "SELECT * FROM ihsreg "; //$term = strtoupper(addslashes($_REQUEST['search'])); $term = strtoupper($_REQUEST['search']); if(stristr($term,"'") && !stristr($term,"\'")){ $term = addslashes($term); } if($_REQUEST['radiobutton']){ switch($_REQUEST['radiobutton']){ case '1': $SQL.=" WHERE Bloom_Name LIKE \"$term\""; break; case '2': $SQL.=" WHERE Pod_Name LIKE \"$term\""; break; case '3': $SQL.=" WHERE Pollen_Name LIKE \"$term\""; break; case '4': $SQL.=" WHERE Hybridiser LIKE \"$term\""; break; case '5': $SQL.=" WHERE Origin LIKE \"$term\""; break; case '6': $SQL.=" WHERE Grower LIKE \"$term\""; break; case '7': $SQL.=" WHERE Color_Group LIKE \"$term\""; break; case '8': $SQL.=" WHERE Bloom_Type LIKE \"$term\""; break; case '9': $SQL.=" WHERE Reg_Mini LIKE \"$term\""; break; case '10': $SQL.=" WHERE Size_Range LIKE \"$term\""; break; case '11': $SQL.=" WHERE Propagation LIKE \"$term\""; break; case '12': $SQL.=" WHERE Bloom_Color LIKE \"$term\""; break; case '13': $SQL.=" WHERE Bloom_Characteristics LIKE \"$term\""; break; case '14': $SQL.=" WHERE Leaf_Characteristics LIKE \"$term\""; break; case '15': $SQL.=" WHERE Bush_Characteristics LIKE \"$term\""; break; case '24': $SQL.=" WHERE Cross_Made LIKE \"$term\""; break; case '25': $SQL.=" WHERE date LIKE \"$term\""; break; default: $SQL.=" WHERE Bloom_Name LIKE \"$term\""; break; } // switch } else { // If they didnt' select a radio button... $SQL.=" WHERE Bloom_Name LIKE \"$term\""; } $result = mysql_query($SQL); $resultCount = mysql_num_rows($result); $SQL.= " LIMIT $offset, $limit"; $result = mysql_query($SQL); if($resultCount > 0){ while($row = mysql_fetch_assoc($result)){ $results[$row['id']] = $row; } // while } // if there are results } // if user performed a search ?>
  5. Hi Everyone I would like to an extension to a value. for example .$BloomName. I would like to add either .jpg, jpe, .gif or Leaf.jpg can someone Help me please $query="insert into ihsreg (SubmitEmail,Bloom_Name,Pod_Name,Pollen_Name,Hybridiser,Origin,Grower,Color_Group,Bloom_Type,Reg_Mini,Size_Range,Propagation,Bloom_Color,Bloom_Characteristics,Leaf_Characteristics,Bush_Characteristics,Photo_Credit,Bloom_Image,Pod_Image,Pollen_Image,Hybridiser_Image,Leaf_Image,Cross_Made,Registrant_Name,date) values ('".$SubmitEmail."','".$BloomName."','".$PodName."','".$PollenName."','".$Hybridiser."','".$Origin."','".$Grower."','".$ColorGroup."','".$BloomType."','".$RegMini."','".$SizeRange."','".$Propagation."','".$BloomColor."','".$BloomCharacteristics."','".$LeafCharacteristics."','".$BushCharacteristics."','".$PhotoCredit."','".$BloomName."','".$PodName."','".$PollenName."','".$Hybridiser."','".$BloomName."','".$CrossMade."','".$RegistrantName."','".$date."')"; mysql_query($query);
  6. Hi I've tried to follow the tutorials, but I'm not that good in coding. Thanks anyway
  7. Hi Everyone I would like  to display 40 images at a time Can someone help me to add a next and previous button, on this script? <?PHP mysql_connect("localhost", "xxxxxx_xxxx", "xxxx") or die(mysql_error()); mysql_select_db("xxxx_xxx") or die(mysql_error()); $sql = "SELECT * FROM `ihsreg` ORDER BY `id` DESC LIMIT 40"; $results = mysql_query($sql); $column = 1; print "<table>"; while(($row = mysql_fetch_assoc($results)) !== false) {    if ($column == 1) { print "<tr>"; } print ' <td> <a href="http://www.mysite/myfolder/cvdata1.php?search=' . $row['Bloom_Name'] . '"> <img src="http://www.mysite/myfolder/' . $row['Bloom_Name'] . '.jpg" width="150" height="150" border="0"> </a> ' .$row['Bloom_Name'] . ' </td>'; if ($column == 5) { print "</tr>"; $column = 0; } $column++; } if ($column < 5) { while ($column < 5) { $column++; echo " <td>&nbsp;</td>"; } echo "</tr>"; } print "</table>";
  8. Hi I'm trying to add a link to the individual image to a set path.+ the image name. I've tried to add the code, but all I'm getting the same text link (Bloom_Name) how can I change the code? please help <?PHP mysql_connect("localhost", "xxxx_xxxx", "xxxx") or die(mysql_error()); mysql_select_db("xxxx_xxx") or die(mysql_error()); $sql = "SELECT * FROM `seedling` ORDER BY `id` DESC LIMIT 25"; $results = mysql_query($sql); print "<table>"; $column = 1; while(($row = mysql_fetch_assoc($results)) !== false) {    if ($column==1) { print "<tr>"; } print "<td>"; print "<img src=\"http://www.mysite/myfolder/";  echo $row['Bloom_Name'];      print ".jpg\" width=150 height=150><br>";     echo $row['Bloom_Name'];      print "<a href=\"http://www.mysite/myfolder/cvdata1.php?search=\">Bloom_Name</a><br />\n";     print "</td>"; if ($column==5) { print "</tr>"; $column=0; } $column++; }  print "</table>"; ?>
  9. Hi I've just installed mysql, I think I followed the instructions ok, but I can't get to run mysql to create a database. the black screen just flashes away, can someone tell me what I'm doing wrong?
×
×
  • 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.