Jessica
Staff Alumni-
Posts
8,968 -
Joined
-
Last visited
-
Days Won
41
Everything posted by Jessica
-
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.
-
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.
-
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.
-
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.
-
You need to check if the $_POST array key isset before trying to use it, and check overall if the form was even submitted.
-
Why are you trying to return the errors? Is this in a function? You need to echo the error, or trigger the error.
-
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.
-
you don't. You NEED to normalize your data.
-
Without seeing more of your code it's impossible to tell.
-
try within your loop doing a print_r($row); and see what's in $row.
-
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?
-
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??
-
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.
-
Maybe try using PHP tags instead of our forum's code tags? :-P Are you using short tags? Try full tags.
-
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.
-
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.
-
Don't forget to call die() after the header.
-
You have written photos as photos. Barand said to do photos as photo. Do you see the difference?
-
Setting A Session Variable As A Cell From Mysql Table
Jessica replied to IanC's topic in PHP Coding Help
First turn on error reporting. Second read the PHP manual on MySQL. Specifically mysql_fetch_assoc -
Query Failed: Unknown Column 'tenantid' In 'where Clause'
Jessica replied to sagisgirl's topic in PHP Coding Help
Read the link in my signature. You're not capturing MySQL errors. -
Subscribe/unsubscribe To/from Article Using Php/ajax
Jessica replied to dave1234's topic in PHP Coding Help
So fix it. -
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.
-
Also look in your log file.
-
You need to turn on error reporting. There are several good links in my signature for you.