Jump to content

Jessica

Staff Alumni
  • Posts

    8,968
  • Joined

  • Last visited

  • Days Won

    41

Everything posted by Jessica

  1. If you refuse to learn, people will stop trying to help you eventually. I would have said quickly, but there are plenty of people here who tolerate intentional helplessness for longer than I do.
  2. Your array keys are strings. You can just type 'title'. That is the key. The value of the array at that key is ALSO just a string, you could type. You're asking the question wrong, so no one understands what you want. Did you even read my post? Because the only thing I can think you're trying to do, you should do with constants. I don't understand why no one else has asked you yet - why are you using extract on an array you just created, and never using the array??? Finally, (hopefully my last edit), we don't know what shortcode_atts does.
  3. function GenerateSitemap($params = array()) { // default parameters extract(shortcode_atts(array( 'title' => 'Site map', 'id' => 'sitemap', 'depth' => 2 ), $params)); // create sitemap $sitemap = wp_list_pages("title_li=&depth=$depth&sort_column=menu_order&echo=0"); if ($sitemap != '') { $sitemap = ($title == '' ? '' : "<h2>$title</h2>") . '<ul' . ($id == '' ? '' : " id=\"$id\"") . ">$sitemap</ul>"; } return $sitemap; } add_shortcode('sitemap', 'GenerateSitemap'); Right now, your code returns a variable it never does anything with. If you want to use something you create within a function outside of that function, return it and assign it to a variable. However for what you're doing it makes more sense to define your default parameters as constants outside of the function.
  4. 1. Use code tags. 2. Check for SQL errors. 3. Do some debugging on your own and find the actual part that isn't working.
  5. You need to check if the $_POST array key isset before trying to use it, and check overall if the form was even submitted.
  6. Why are you trying to return the errors? Is this in a function? You need to echo the error, or trigger the error.
  7. That code wouldn't be readable with code tags anyway. OP: Click the toggle button in the top left of the text editor to get to plain text and copy and paste your code in there to preserve the formatting.
  8. you don't. You NEED to normalize your data.
  9. Without seeing more of your code it's impossible to tell.
  10. try within your loop doing a print_r($row); and see what's in $row.
  11. Although re-reading your post it sounds like your while loop simply has no values to loop over. Did you verify that your query produces results?
  12. while ($row = sqlsrv_fetch_array($result, SQLSRV_FETCH_ASSOC)) { [code] echo "<tr> <td>{$row['Rep']}</td> <td>{$row['Num_Payments']}</td> </tr>"; } [/code] You don't see how you have random code tags in there??
  13. The editor you use to write PHP is irrelevant to connecting to the database, just so you know. You should also look into a full IDE, we have a thread in misc about different ones.
  14. Maybe try using PHP tags instead of our forum's code tags? :-P Are you using short tags? Try full tags.
  15. You shouldn't have to declare $data = NULL; unless you're trying to reuse a variable you already had filled with an array. A good reason to use descriptive variable names. All variables contain data.
  16. Try using print_r on the value to see what's in the array. Or if you're confused about why it's an array you need to look at the code that creates the value. This code doesn't show the creation of $data.
  17. Don't forget to call die() after the header.
  18. You have written photos as photos. Barand said to do photos as photo. Do you see the difference?
  19. First turn on error reporting. Second read the PHP manual on MySQL. Specifically mysql_fetch_assoc
  20. Read the link in my signature. You're not capturing MySQL errors.
  21. Dude it's a joke. You're the one being whiny and complaining about living in the US. Go ahead and see if any other country will take you if you think it's that bad. Otherwise stop posting all this irrelevant stuff. We don't care where you live. We don't care if you think you're the business mogul we all should bow down to. If you actually need help with PHP as you claim, post about that but the whinging about random bull shit is old.
  22. You need to turn on error reporting. There are several good links in my signature for you.
×
×
  • 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.