Jump to content

Help sql select...


ivanella

Recommended Posts

ivanella: Did you try my example? Did it work?

 

Rohan Shenoy:

 

Yes, and it's always good to try everything possible and get everyones ideas. More brains are better then one.

 

Note: If you want to get really, really, really, really, technical, there are 5 indications that the name 'attori' is a PHP variable and none of those 5 indicators appear on the 'link_field6' fieldname. Those find indicators are left and right single quotes, left and right curly brackets and the dollar sign. A SQL field name would not be quoted in a situation like this, would never have the curly brackets or the dollar sign. So if the person writing this code put all of those characters in on one PHP variable that indicated it was a PHP variable, there is a good chance that they would also at least include 1 of those indicators on the 'link_field6' name.  Also the word 'field' appears in 'link_field6' which also suggests that could be a SQL field name.

 

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/103290-help-sql-select/#findComment-529011
Share on other sites

If your $attori variable contains multiple names like you mentioned, you can replace all of the spaces between the names with '%' before using it in the SQL query, so that it would match each word in it rather then the whole string.

 

<?php
$attori = str_replace(' ', '%', $attori);
?>

Link to comment
https://forums.phpfreaks.com/topic/103290-help-sql-select/#findComment-529014
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.