I have this symfony code where it retrieves all the categories related to a blog section on my project: This works, but the query includes duplicates: I want to use the DISTINCT command in my query. The only examples I have seen require me to write raw SQL. I want to avoid this as much as possible as I am
Tag: php
Don’t reset form values after submit
After giving a preview by php header code, I want to not reset the input boxes? Thanks. This is my simplified code: html Code Answer You have to give all the input boxes a value attribute equal to the previously submitted value.
How to get the message body from PHPMailer?
I use PHPMailer to send email via SMTP. It works, but it doesn’t save the sent emails in sent items. I want to make to sent emails in the sent items, any idea? I know can use imap_append function …
php return 500 error but no error log
I am having an issue when I have a php application that is returning an internal server error (500) however nothing is showing up in the error log. Now I know there are error with what I am trying to …
Automatically insert Line break?
I’m making a news posting system and I was wondering if it is possible to automatically insert a <br /> tag where ever there is a new line? For example, if posted a news article with the following text in the text area: it would add this to the news database: Is there a way to do this? Answer http…
Database Design For Developing ‘Quiz’ Web Application using PHP and MySQL
So, I’m trying to learn PHP and MySQL (I have a basic understanding of both; I’ve read the first half of both Head First SQL and Head First PHP & MySQL) and I figure the best way to solidify my knowledge is by building something rather than reading. With that in mind, I would like to create a …
Contact form 7 post to .asp
Is it possible to post the form contents of Contact Form 7 form fields to an awaiting .asp page? My form has four input fields and one hidden field. Name, Telephone, Email, HowFoundUs, Refer. I want to post those input values to the following .asp page: clientsite.com/default.asp?name=xxxxxx&telephone=xxx…
PHP & MySQL: How can I use “SET @rank=0;” in $query=
In my PHP file, I use this line to pull data from my mySQL database: If I check the SELECT statement in phpMyAdmin’s SQL window (without $query= ) it works fine. But, if I use it in PHP, then I get an error. It doesn’t like the “SET @rank=0;” bit. Is there a way to use “SET @rank…
How to convert video to mp4,webM,ogv while uploading ?
i am using videojs to play video on my website(it’s a HTML5 website) so for a better support i need to make 3 formats of each video mp4,webM,ogv. But in my website user can upload video also. So please tell me how can i automatically convert videos after/while uploading to these formats. I am using PHP5…
Anyone ever used PHP’s (unset) casting?
I just noticed PHP has an type casting to (unset), and I’m wondering what it could possibly be used for. It doesn’t even really unset the variable, it just casts it to NULL, which means that (unset)$anything should be exactly the same as simply writing NULL. Anyone ever used it for anything? I can…