Skip to main content
rlc22
Participant
October 8, 2006
Question

Wildcard in MySQL Query - Part 2

  • October 8, 2006
  • 4 replies
  • 399 views
Thank's David.
Worked a treat. The key was uisng LIKE not =

However, while it works on the events page, when I try and do the same thing on a similar page, but for a different table, I have the following problem...

The SQL works fine, but as soon as I try and access the database from the page (i.e. using live data view of running the page on the website), i get the following error:

Fatal error: Call to undefined function: getsqlvaluestring() in /home/sites/enagri.info/public_html/enagri_info/news/#pagename# on line #line no.#

The line in question reads:
$query_rsNews = sprintf("SELECT newsDate, newsHeadline, newsLink, newsLocation, newsCategory FROM news WHERE newsLocation LIKE %s ORDER BY newsDate DESC", GetSQLValueString($location_rsNews, "text"));

Is this anthything to do with the fact that the values in the location table are integers and not text? However, it doesn't seem to be putting this code on the events page?

Any ideas?

P.S. - Haven't posted this a reply as when I try my browser keeps crashing.
P.P.S. - David, wasn't trying to say I didn't want to learn, but as a newbie, there's no halfway house. It sometimes seems that you end up having to learn adanced SQL from manuals that don't make sense, for a simple 4-line query...
🙂
This topic is closed to new replies. Start a new post to keep the conversation going.

4 replies

Inspiring
October 8, 2006
rlc22 wrote:
> Fatal error: Call to undefined function: getsqlvaluestring() in
> /home/sites/enagri.info/public_html/enagri_info/news/#pagename# on line
> #line no.#
>
> Any ideas?

GetSQLValueString() is a custom-built Dreamweaver function. It's not
part of core PHP. You need to copy the function from a page with a
recordset in it and include it in your page.

> P.P.S. - David, wasn't trying to say I didn't want to learn, but as a newbie,
> there's no halfway house. It sometimes seems that you end up having to learn
> adanced SQL from manuals that don't make sense, for a simple 4-line query...

Fine. We all have to start learning somewhere. Unfortunately, there are
a lot of people who come to this forum with the attitude that they don't
want to learn. Working with any server-side language and SQL is a
massive subject. Dreamweaver can give a rapid boost to a beginner's
skills, but you do need to put in quite a bit of effort yourself if you
want to move beyond the basics.

--
David Powers
Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
http://foundationphp.com/
rlc22
rlc22Author
Participant
October 8, 2006
David, thanks.

I may be being thick, but the page already has a working recordset.

> GetSQLValueString() is a custom-built Dreamweaver function. It's not
> part of core PHP. You need to copy the function from a page with a
> recordset in it and include it in your page.

What am I looking to copy, and where does it need to go?