| bio | website | ticketreview.net |
|---|---|---|
| location | ||
| age | ||
| visits | member for | 1 year, 1 month |
| seen | Mar 22 at 21:39 | |
| stats | profile views | 1 |
SEO Specialist with passion for Startup Internet Businesses.
|
May 17 |
awarded | Popular Question |
|
Oct 31 |
comment |
Redirect deleted posts to category archive Il give it a go and let you know. Hopefully I can get it to work automatically. |
|
Oct 31 |
comment |
Redirect deleted posts to category archive Would that solution mean my pages are still indexed and therefore I would have hundreds of outdated pages indexed or would that template_redirect work for google... The main aim is SEO so would this work. thanks |
|
Oct 31 |
asked | Redirect deleted posts to category archive |
|
Apr 20 |
awarded | Tumbleweed |
|
Apr 13 |
accepted | If no posts in category display Form instead of not found. |
|
Apr 3 |
awarded | Scholar |
|
Apr 3 |
accepted | SQL Query inside Widget |
|
Apr 3 |
comment |
SQL Query inside Widget Thank you very much... The problem is that I was using the_field instead of of get_field.. The full query to pull data from the database based on customfields is : <? global $wpdb; $test = get_field('country'); $row = $wpdb->get_row($wpdb->prepare("SELECT * FROM wp_venues WHERE name = %s", get_field('venue'))); echo "Name: ".$row->name."\n"; ?> |
|
Apr 3 |
comment |
SQL Query inside Widget I have a PHP widget named php-code-widget... This is the exact code in the widget: <? global $wpdb; $row = $wpdb->get_row($wpdb->prepare("SELECT * FROM wp_venues WHERE name = %s", the_field('venue'))); echo "Name: ".$row->name."\n"; echo $wpdb->last_query; ?> RESULT: Name: SELECT * FROM wp_venues WHERE name = '' |
|
Apr 3 |
comment |
SQL Query inside Widget hi unfortunately not. The custom field is not being passed into the query. The custom field can be echoed in the widget no problem but when used in the query it returns blank.. |
|
Apr 3 |
awarded | Student |
|
Apr 3 |
awarded | Commentator |
|
Apr 3 |
comment |
SQL Query inside Widget appreciate the help. So now I can see that the the_field('venue') is not being passed into the query. I assumed this was because it displays fine in the widget.. |
|
Apr 2 |
comment |
SQL Query inside Widget ok, yes.. <? global $wpdb; $row = $wpdb->get_row( $wpdb->prepare("SELECT * FROM wp_venues WHERE name = %s", the_field('venue'))); echo $row->name; ?> ERROR: Notice: Trying to get property of non-object .. echo $row->name; throws the error message. |
|
Apr 2 |
comment |
SQL Query inside Widget Debug True: Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or '; php-code-widget/execphp.php(44) : eval()'d code on line 2 AND <?php $wpdb->print_error(); ?> shows nothing.. |
|
Apr 2 |
comment |
SQL Query inside Widget No results are being returned so the quieres I have been trying have not been working. Strange. I have tried 4 or 5 now inside a PHP widget. Custom fields are displaying ok but not any query. I have even tried simply queries which I know have a result. |
|
Apr 2 |
comment |
SQL Query inside Widget I have tried both my query and yours above. The wp_venues table contains 5 columns, id, name, capacity, image, description. print_r($row) not showing anything. |
|
Apr 2 |
comment |
SQL Query inside Widget Hi yes I see how you have done it but for some reason it is not working for me. None of the echo variables are working , only the name which is because of the_field('venue'). |
|
Apr 2 |
comment |
SQL Query inside Widget Hi yes, thanks but what I need is to separate the results into variables that I can format, at the moment it selects the row as a whole. Any ideas. |