Jump to content

mattgleeson

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

mattgleeson's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks for the help - that was a super quick response time.
  2. Hi I've just tried loading an application that I wrote some time ago. Throughout the application I use the <?= php tag. I'm now running PHP 5.2.x and I've noticed that the compiler seems to be ignoring these tags and printing them as text rather than executing the PHP script contained within the tags. Are the tags still supported? Is there some way of enabling/disabling them in php.ini? Cheers
  3. Thanks for your reply. Unfortunately I already store the contents twice in the database and the database has the potential to grow big so storing the content a third time in the DB isn't really an option. The second copy of the content I store in the DB isn't html formatted but it is split up into different sections and the table uses InnoDB so I can't do full text searching on it.
  4. Hi I need to create a search engine for my website. It will search page content stored in the MySQL database. The content stored in the database is pre-formatted with html and when I do a fulltext search against the content I want it to ignore matches of search words which are enclosed in tags (i.e. html tag keywords). I.e. if someone does a search for 'style', I don't want it to match instances of 'style' enclosed in html tags < > like <div style="abc"> etc. Row 1 contents might be '<div><p>this years style is ...</p></div>' Row 2 contents might by '<div style="abc"><p>this years fashion is ...</p></div>' I want the fulltext search to match row 1 but not row 2. Is this possible to do this with fulltext searches and if not, can you give me advice on how to search html formatted text stored in the DB without matching html tags (if the user happened to search for a word that is also a html tag) Many thanks in advance
  5. Hi I need to display html stored in a database on web page but when I display the html I need to convert all html special charaters outside of html tags into html entities. The php functions htmlentities() etc don't do what I need as they seem to translate ALL applicable symbols to HTML entities. What I need is a function that is a bit smarter in that it only transalates applicable symbols that are OUTSIDE tags into HTML entities. Is there any php or even smarty functions that do this or can you give me some help/tips the best way to achieve this? Cheers
  6. Hi I use prepared statements with the mysqli extension for all my database calls. I have recently implemented smarty in my app and am having trouble looping over a result set returned using prepared statements. it seems that when using prepared statements the result set cannot be returned as an array and must instead always be bound to php variables. How then do I loop over a result set using bound variables with smarty's <section> tag? Am I right in saying the <section> tag only works with an array set? Cheers Matt
  7. ok I found this error in the apache error_log: child pid xxxx exit signal Segmentation fault (11) Just trying to resreach the net and see what I can find. It must have something to do with conflicting libraries. If anyone has experience with this error....
  8. I've checked the extension exists in my /etc/php.d/ directory. I've also checked it appears in the phpinfo output (see below). mysqli: Client API library version  3.23.58  Client API header version  5.0.22  MYSQLI_SOCKET  /var/lib/mysql/mysql.sock  Directive Local Value Master Value mysqli.default_host no value no value mysqli.default_port 3306 3306 mysqli.default_pw no value no value mysqli.default_socket no value no value mysqli.default_user no value no value mysqli.max_links Unlimited Unlimited mysqli.reconnect Off Off Because it can connect to the database using the mysqli_connect function means that it must be using the mysqli extension. Is there any DB connection logs I can check? Im using the standard mysql module in another application on the same server and that works fine talking to the database. Just seems to be isolated to the statement prepare command with the mysqli library. FYI -  i didn't actually install php on the server. I think it had version 4.x on it already when i first got access to the server and i ran the php 5.14 rpms. Im quite new to installing/configuring php on Linux so maybe I haven't configured something correctly?
  9. Thanks for your reply. I have put the check in like you said but there is no error returned and if I do a echo $dbConn1->stat() i get the following which tells me it can connect fine to the DB: Uptime: 386706 Threads: 1 Questions: 5126 Slow queries: 1 Opens: 128 Flush tables: 1 Open tables: 59 Queries per second avg: 0.013 printr($stmt) after initialising it it says: object which is what it is supposed to return. So the problem seems to lie with the prepare statement. The fact that the prepare doesn't return false (Or anything) but instead crashes the page makes me suspect there is something else going on such as somethiing with mysql not being configured correctly etc. Does anybody have any details on what prepare() actually does  / what it needs to work? Does it need a specific version of mysql? Is there any kind of database/mysql logs I can check? Thanks again
  10. I am moving my site from development on a windows box to test on a linux box. MySQL and PHP were both installed already on Linux, both running version 5.x I am having trouble talking to the database now. I use the mysqli library to talk to the database. Even though I have set the display_errors = on and error reporting to all, I dont receive any errors and instead just get the default 'cannot find server - cannot display page'. Without any errors to go off im really struggling to figure out what the problem is. It seems to be with the prepare statement call. Any idea why this would fail? Is there a setting in MySQL or the php.ini needed for the prepare statement to work. Below is my test code that is failing: when it tries to prepare the statement it fails, gives no php error and gives me 'cannot find server' page: $dbConn1 = new mysqli("localhost", "user", "password", "db"); $stmt = $dbConn1->stmt_init(); $stmt->prepare("select * from table"); <-fails here I have been going around in circles for a day now, any help or ideas would be appreciated. Thanks
  11. I am in the process of converting my app to use the new mysqli library and using bound parameters/results etc. I am having trouble selecting dates from the database when storing the result. I need to perform a select query on a date column and a LONGTEXT column in the same table. Because, as I understand it, I need to store_result in order to get the data for the LONGTEXT column, but in doing so it stuffs up the data returned for the date column. How do I get around this as I dont want to do 2 different database queries just to get the data from the same table. At the moment I create a connection to the database, prepare a database statement, bind the paramters, execute the statement, store the result (store_result), bind the return parameters, fetch the data. The LONGTEXT data is returned fine but the date data isn't. If I don't store the result, the date data is returned fine but then obviously the LONGTEXT isn't. The incorrect date or LONGTEXT comes out of the DB looking like: 2tmtdqXJs Is this a bug in mysqli or am I missing something? Cheers
  12. Hi New to the forum, so sorry in advance if this question is supposed to be in another forum. I have created a function containing some parameters and now want to call this function but only pass in some parameters using the the parameter's name. i.e. function someFunction($paramA=NULL, $paramB=NULL, $paramC=NULL){ return NULL; } //in my code somwhere i want to do something along the lines of: $variable = someFunction($paramB=>"value"); Is this possible? Cheers
×
×
  • 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.