Jump to content

rhodesa

Staff Alumni
  • Posts

    5,253
  • Joined

  • Last visited

About rhodesa

  • Birthday 09/27/1983

Contact Methods

  • Website URL
    http://vectorloft.com

Profile Information

  • Gender
    Male
  • Location
    Boston, MA

rhodesa's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. you may want to switch back to your print() function instead of printf(). i personally prefer printf() cus i think it looks cleaner. The basic jist of it, is you put a %s wherever you want the variable inserted, and then add the variables as arguments. so it would be like this: printf('<a href="view.php?name=%s"><b>%s</b><br>%s</br><br></a>',$row['name'],$row['name'],$row['address']);
  2. The only thing I can think of then is that the first character of the name is a blank character or something...what is the output of: <?php $sql = "SELECT SUBSTR(first_name,1,1) let, count(*) cnt FROM `agents` GROUP BY let"; $result = mysql_query($sql) or die(mysql_error()); while($row = mysql_fetch_assoc($result)){ print "{$row['let']}: {$row['cnt']}<br />"; } ?>
  3. they all have a separate variable. you will find the same thing on most CMS installs (like Joomla, etc). you could try to subtract the $_SERVER['DOCUMENT_ROOT'] from it, but i tend to keep stuff out of my web root and then use symlinks...so you will run into issues there
  4. instead of block, use 'table-row': document.getElementById('tr1').style.display='table-row'; if you didn't have the style on to start, you could do: document.getElementById('tr1').style.display='none'; document.getElementById('tr1').style.display=''; setting it to empty will restore it to it's default...but you default it to none...so that won't work
  5. you will need another variable then.... <?php //Filesystem path to uploads $settings['uploadpath'] = '/full/path/to/uploads/dir/'; //URL Path to uploads $settings['uploadurl'] = '/folder_name/folder_name/whatever/'; ?> there is just no GOOD way to translate the filesystem path to a URL
  6. use curl_setopt($ch, CURLOPT_POST, TRUE); you currently have it set to false edit: you may also want this: curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); just in case there is some redirect that happens
  7. I can't see anything wrong with this code: <?php $letter = isset($_GET['letter']) ? $_GET['letter'] : "A"; //Show all restaurants that start with $letter $sql = "SELECT * FROM restaurants WHERE UCASE(name) LIKE '{$letter}%'"; $result = mysql_query($sql) or die(mysql_error()); while($row = mysql_fetch_assoc($result)){ printf('<div align="left" width="100"><b>%s</b><br>%s</br>%s</br></div><hr color=#000 width=200></hr>',$row['name'],$row['address'],$result['cviolations']); } //alphabetical pagination links echo '<div align="center"><b>'; foreach(range('A','Z') as $c){ ($letter == $c) ? printf('%s&nbsp',$c) : printf('<a href="?letter=%s">%s</a> ',$c,$c); } echo "</b></div><p>"; ?>
  8. What does your cURL code look like? it should be something like: <?php $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt($ch, CURLOPT_TIMEOUT, 10); curl_setopt($ch, CURLOPT_POST, TRUE); curl_setopt($ch, CURLOPT_HTTPHEADER, Array("Content-Type: text/xml")); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POSTFIELDS, $xml); curl_exec($ch); ?>
  9. Is that on a private network, cus I can't get to it.
  10. <?php if ( $_POST['submit'] ) { foreach($_POST['mytext'] as $key=>$value){ echo "$key: $value<br />"; } } ?> <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" ?> field 1 : <input name="mytext[text1]" size="20" > <br> field 2 : <input name="mytext[text2]" size="20" > <br> field 3 : <input name="mytext[text3]" size="20" > <br><br> <input type="submit" name="submit" value="test"> </form>
  11. The question is too vague. Please post some of your code. What is the value in that "variable" you speak of?
  12. what happens if you run this code: <?php $letter = isset($_GET['letter']) ? $_GET['letter'] : "A"; //Show all restaurants that start with $letter $sql = "SELECT * FROM restaurants"; $result = mysql_query($sql) or die(mysql_error()); while($row = mysql_fetch_assoc($result)){ printf('<div align="left" width="100"><b>%s</b><br>%s</br>%s</br></div><hr color=#000 width=200></hr>',$row['name'],$row['address'],$result['cviolations']); } ?>
  13. rhodesa

    [SOLVED] ENUM

    Why must it be done in the query? Try this: SELECT (CASE fieldName WHEN 1 THEN 'Yes' WHEN 0 THEN 'No' ELSE 'No' END) FROM tableName
  14. You need a LEFT JOIN SELECT * FROM pu_sched AS pu LEFT JOIN client_pu_site AS st ON st.client_id=pu.client_id WHERE `pu_date` = ''
  15. is the column called "date"? don't use a column named date, as it is a reserved word in MySQL...if it MUST be called date though, it would look like: 'SELECT * FROM links WHERE active = 1 AND subcat = '.$x.' ORDER BY `date` ASC LIMIT 0,10'
×
×
  • 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.