Closed outflux3 closed 12 years ago
the queries are a bit particular with spaces. make sure you have a space eitehr side of the '=' when doing a WHERE
i haven't been able to get the where to work, even with the space outside of the = sign; for now i'm using an array filter to get this done...but would be interested to know what's causing my WHERE to not work, could it be something to do with the field name?
Shawn wrote a new function for doing queries.. try it first without the limit and order by just to make sure it is the WHERE thats causing it...
$myquery = "SELECT id,artist_name,bio_teaser,bio_full,artist_link,artist_image,artist_type,slug FROM artists WHERE artist_type = 'actor' ORDER BY artist_name ASC LIMIT 14";
$result=DM_query($myquery,DM_MULTI);
echo '<pre>'.print_r($result,true).'</pre>';
ok, just confirmed it is the "_" in the field name thats causing the problem.
ok, for now my array filter is working, so i'll leave that as is, but for some other sites/projects, i should wait until the _ doesn't mess things up, or just switch to camel case for the field names.
not too hot on regex so might see if the expert (shawn) can take a look at it.
Looks like its treating the underscore as a special character which it should be doing in a WHERE / LIKE
Either that or we limit the field name to alphanumeric only.
on the other site i'm working on, i think i'm going to take out all of the underscores from the field names and see how it goes...
works fine everywhere except for when doing a WHERE on a field name with underscores...
Have some nice new updates coming in the next day or 2, off work for a couple of weeks so I'll have plenty of time to concentrate on this and shortcodes and get them on to extend.
I have an issue open on this, ill take a look at it today, sorry been working on my own plugins and lots of core updates for getsimple lately.
great - matrix is really working well; i think that a case study might be most helpful for people who want to try it out; i could use 1 or 2 of the sites i just completed with it, and present all of the code, within the functions and then the template used to output the records as pages; here's an example: andylaster.com/discography/ one thing i did yesterday was to add a link on the gs pages view directly to the table, like this:
load.php?id=DM_Matrix&action=matrix_manager&view=discography
maybe it would be cool to have a feature within matrix to add a link like this to the pages sidebar, so that clients can avoid going to Matrix then to the table.. maybe a preference within the table options...
thanks guys, really appreciate the help and time you have put into testing etc...
@tablatronix, no rush on it, nice work on GS the last few days BTW.
@outflux3 , site looks great. WIll add that to the improvements for this week. I had it there originally and removed it.
@n00dles thanks - that will be great; i'll post the other site i'm doing with matrix once it's out of the 'dev' subdomain next week... it's been a real lifesaver on these projects...
Think this is sorted now.
I can't seem to get a WHERE clause to work...trying to filter some table results; any suggestions?
$actors=getSchemaTable('artists',"SELECT id,artist_name,bio_teaser,bio_full,artist_link,artist_image,artist_type,slug FROM returnArray WHERE artist_type='actor' ORDER BY artist_name ASC LIMIT 14");
cheers!