Statement Results In Blank Page
I'm constructing a blog for my site. After I got nowhere trying to automatically configure dd-mm-yyyy dates on the fly, I decided just to write the dates manually and order the posts by automatically incremented id instead.
However, in constructing my monthly archive pages I've come up against a problem. Here is the PHP I'm using to get the info from the database:
$blog = mysql_query ("SELECT title, content, date FROM blog WHERE date IN ('August 2005') ORDER BY id DESC LIMIT 10") or die(mysql_error());
The date column in my table is VARCHAR and all the entries so far contain the characters August 2005 but all I get is a blank page. I'm using this while loop to display the results:
while ($entry = mysql_fetch_array($blog)){
echo '
<p class="blogdate">
'. $entry['date'] .'
</p>
<h2>'. $entry['title'] .'</h2>
<div class="blog">
'. $entry['content'] .'
</div>
';
}
View Complete Forum Thread with Replies
Sponsored Links:
Related Messages:
Multiplication Statement Returns Blank Results
I am atmysqlting to write a MYSQL statement that multiplies two different column values (price x time_rate) and displays the new value in a "completion_rate" column. All the values display correctly except for the blank value in the "completion_rate" column. INPUT SELECT quote.quoteid, quote.size, rate.size, rate.price, timeframe.time_rate, rate.price*timeframe.time_rate AS completion_rate FROM quote, rate, timeframe WHERE quoteid = #URL.quoteid# AND rate.size = quote.size AND quote.completion = timeframe.time_range OUTPUT quoteid size size price time-rate completion_rate ------- ---- ---- ----- --------- --------------- 10 18x20 18x20 1710.00 0.50
View Replies !
View Related
Blank Page In Php Page With Mysql Query
I've installed PHP 5.1.2 manually, along with MySQL 4.1.18. Any php page that contains a mysql function displays a blank page . I read many article on mysql and php configuration and did not find any issue ... I copied the libmysql.dll to the system32 directory I set the extension_dir in php.ini to the extension directory of my PHP installation directory I enabled the MySQL extension in php.ini by uncommenting the line extension=php_mysqli.dll I tested the mysql connection from a dos prompt it worked , i can check ith a show database the list of the databse . But each time i put come synatc mysql in a php page the resultis a blank page . I read that we neee in php5 mysqli.dll but I found only mysql.dll do i have just to renme it..?
View Replies !
View Related
Mysql_connect() Returns A Blank Page
I already installed Apache 2.0, PHP 5, MySQL 4.0 on my local machine. The php and apache are already set and it can process php scripts without problems. On the other hand, i can access my MySQL database, create table and others using the MySQL Monitor or the MySQL Manager. Now, i will try to connect to my database; my problem is, the php script that has the mysql_connect() returns a blank page. Here's the code: ......
View Replies !
View Related
Blank Page When Attempting To SELECT Data
We're storing data in a mySQL database via a php script. For some reason, every week or so (depending on how many connections were making) my PHP scripts just quit working. Restarting mySQL resolves the problem. I've checked to make sure that all of the scripts are closing the database after posting/selecting the data. Any other suggestions on why this might be occuring?
View Replies !
View Related
Page Results By Timestamp
I've been racking my brain on this for a couple of hours now, so i'm hoping that maybe someone can give me a hand. I want to show results by timestamp and give an individual page per date. All of the rows are given a timestamp of midnight of the date they were added. I just can't figure how I am to return the results of the query. The query i'm using for the content. PHP $query = "SELECT id,timestamp FROM content ORDER BY timestamp DESC LIMIT $limitvalue, $limit"; The limit and limit value are part of the paging script that I have.
View Replies !
View Related
PHP Page Displaying When First Hit, Page Not Found On Refresh.
I have installed MYSQL sucessfully and PHP. I usually code in ASP (I know, I know) & SQL Server (Yes OK). And have recently turned to the light! When I load a page for the first time (On IIS) it looks fine and new data change in the database is displayed and it looks great. When I click a link to another page with links to the DB then I get Page Cannot be found, if I go back to the URL for the site (thus index.php) Refresh and then click the link it works??!
View Replies !
View Related
SELECT Statement Produces 0 Results When Certain Keywords Are Used In WHERE Clause
I have a prepared SQL statement which is activated when a search is entered for products at my particular site. The search string is broken out into keywords and then the statement is constructed so that certain columns in certain tables for my products are searched for the presence of each of the keywords. Each keyword needs to be in at least one of the columns or that row will not be returned. Sometimes the statement works and sometimes not, depending on which keywords I've entered. I have a test product I'm using so I know which keyword combinations work and which won't. All of them are supposed to work, but in certain instances the statement returns 0 results. I'm hoping that you can look at my statement and see where I've made some--probably obvious--error. First I'll quote the statement code and then explain what the columns mean and what is supposed to be happening') ....
View Replies !
View Related
MYSQL SELECT Statement Depening On Search Results
I have a search form that contains 3 dropdown boxes: - search_bedrooms - search_price - search_area Each of these boxes contain values which will get info from a database when submitted, but they also have a value called [no preference], this is selected when the user doesn't want to search for any particular value. When submitted it goes through to a page which has a MYSQL SELECT statement: $query = "SELECT * FROM property_details WHERE area = '$search_area' AND price = '$search_price' AND bedrooms = '$search_bedrooms'"; What I need to know is if the user selects [no preference] on any one of the dropdowns, how can I make the above SELECT statement not include that in the search, but still search on the other criterias. (e.g. if in the search_bedrooms dropdown I selected [no preference], how could it be excluded from the search, but still include area and price?) I know it can be achieved with multiple SELECT statements,
View Replies !
View Related
Zero = Blank = Space
how I can change it if possible: mysql> select count(*) from property where number = 0 and number = "" and number = " " and number = " "; +----------+ | count(*) | +----------+ | 43 | +----------+
View Replies !
View Related
Non-blank Fields
Is there a way to select all non-blank fields when doing a select statement in SQL? For example, I want to run the query "Select * from <tablename> where username = <username>" The result set contains many columns that are completely blank, as the database I'm working with contains over 100 fields. Is there a way to tell it not to display those blank columns in the result set?
View Replies !
View Related
Blank Date Field
How do you determine if a Date field is blank. In my Sql statement I only want records who's date field is blank (i.e. checking for only open invoices where Date_Paid = '' ...still open ...it doesn't work when I use that syntax)
View Replies !
View Related
Eliminating Blank Values
I have a database randomly scattered with 'NULL' values, being a newbie to mysql, I was wondering if there was a single command to replace all 'null' values with a string 'no data'. all the fields are set to hold 255 character strings.
View Replies !
View Related
Blank Username In Mysql Db
Using a Virtual Private Server -UNIX & Apache 1.3.22 & mysql 3.23.46 I was able to create the mysql root password, however the system will not let me create the admin password (which is supposed to be the same as my account name). When I checked the database to see the current names, this is what I got below: Code:
View Replies !
View Related
Mysqlimport For A Blank Database
I have a blank database saved in a mysqldump export file. I have same version of mysql on both machines. I am wanting to just import the blank backup database to the new blank sql server ( no databases or tables on server). I keep getting an error message and it will not allow me to import the blank database. What is my sytax supposed to look like?
View Replies !
View Related
Test For A Null Or Blank
Please look at this sql: SELECT name, visual_no, type_aid, aid_topic1, aid_topic2, aid_topic3, length, date_format(when_made, '%m-%d-%y') as when_made, reserved, date_format(res_beg, '%m-%d-%y') as res_beg, date_format(res_end, '%m-%d-%y') as res_end, notes, no_check, check_out, ge.genreid, gen_short_description, sb.subjectid, sub_short_description, specificid, spe_short_description FROM aids ad, tbl_genre ge, tbl_subjects sb, tbl_specific_subject ss WHERE aid_id=1280 AND (aid_topic1 = ge.genreid OR aid_topic1 is null) AND (aid_topic2 = sb.subjectid OR aid_topic2 is null) AND (aid_topic3 = specificid OR aid_topic2 is null) This is for an audio visual library (dvd, vhs, etc.) The database for record 1280 (and many others) contains in the genreid a number (it has data in other words). aid_topic2 and and aid_topic3 are either blank or have the word [NULL] in the field. I am using MySQLCC, if this matters. This SQL brings back a cartesian product. if I just keep the SQL without the ORs it will not bring back a row because there isn't always an equality between the main table and the lookup tables. Sometimes the main table has a row that has no value in the topics and therefore does not equal the lookup table. I did not design the table. I inherited it.
View Replies !
View Related
Ignoring Blank Fields
Im having a problem where im allowing the user to identify a row by 1 of 2 unique fields. The problem i have is that my current query states to either take a OR b... so my query looks like this. a = $a OR b = $b Now these unique fields can also contain a result of null. Which means that im returned with more than 1 result when only 1 of the unique fields is entered. Is there a way of escaping results that contain null in either of the fields?
View Replies !
View Related
Parent_id: NULL, Blank Or 0
My categories table looks like this: category_id category_name category_parent_id custom_category_name custom_category_parent_id I will be using COALESCE to get the first non NULL value when I query category_name, category_parent_id, custom_category_name and custom_category_parent_id like so: MySQL SELECT category_id, COALESCE(custom_category_name, category_name) AS category_name, COALESCE(custom_category_parent_id, category_parent_id) AS category_parent ... I have set the default value of custom_category_name and custom_category_parent_id to NULL. category_id and category_name will always be present. But what should I set for category_parent_id? Sometimes it won't have a value (when the category is a parent category) and sometimes it will have a value. Should I set category_parent_id's default value as NULL or 0 or blank?
View Replies !
View Related
Blank Columns Or Separate Tables
I have a form with 8 fields, 4 of which are required and 4 are not. Usually if a field isn't required I would create a separate table for it rather than having a blank value in the table where required values would go. In this case, I'm not sure if I should put all the not required fields in one table or separate tables. Since any one of them can be or not be blank. I'm trying to find a balance between normalization and practicality for the database, as well as programming. So, are columns with blank values acceptable to a certain number? Are 4 separate tables too many, so that there aren't any blanks in a column if they were in one table?
View Replies !
View Related
Removing Blank Tabs In Rows
Some of my earlier rows (Database is about 360mb) have blank tabs between text, i can I modify each row and delete the tabs so the size is smaller? I searched php manual didn't find a helpful function, maybe someone else has done this?
View Replies !
View Related
Root Password Blank By Default?
I installed mysql correctly I am assuming navigated to mysqlin and ran mysqladmin C:Program FilesMySQLin>mysqladmin -u root -p password Enter password: *********** mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user: 'root@localhost' (Using password: YES)' C:Program FilesMySQLin>mysqladmin -u root -p password Enter password: mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user: 'root@localhost' (Using password: NO)' I am unable to log on as root and change the password. It says leave the password blank by default. I still will not let me connect. Do I have to start mysql.exe and type the mysql admin -u root from there
View Replies !
View Related
Passwords, Permissions, And Blank Users
I have Apache 2 server, PHP5, and the latest MySQL installed on my system. I'm currently reading PHP and MySQL for Dummies (I told you I was a newbie) and trying to work through a few of the examples.One thing I noticed when I looked at the "users" table in the "mysql" database is a blank user with all privileges on localhost. I deleted that entry, set a password for my "root" account, and created another account with a non-blank password. The problem I am having is that I am trying to connect to the database as "root" with a blank password, and it's still working. I then tried a blank user, and it worked. I tried a random assortment of letters and numbers, and it worked.
View Replies !
View Related
Blank Password When Restarting The Machine
I mainly use MySQL Administrator to create/update table/users/etc. And I noticed that whenever I restart my machine (Windows 2003 Server with MySQL database running) and login to the MySQL Administrator, it takes blank or wrong password for any user account including root. So I end up resetting my root password. Does anyone know why it keeps happening?
View Replies !
View Related
When Restarting The Service, Blank Password
When I stop the service and restart the server, it takes blank/wrong password for any user account including root. Only after I reset the password for root, then the passwords for all the other accounts work fine. What is causing this problem? I don't have the root with % host. And all users under user table in mysql database has passwords set.
View Replies !
View Related
PHP Script Inserting Blank Text Into MYSQL
Have been following a tutorial which has following line in PHP script to write text form Flash form into an MYSQL DB and then redisplay it back in the form Relevant code is: $Connect = mysql_connect($DBhost, $DBuser, $DBpass) or die("News=Uh Oh, Could not connect"); mysql_select_db($DBName, $Connect); $result = mysql_query("INSERT INTO $table (UserName, News, TimeAdd) VALUES ('$UserName', '$EnterNews', '$Today')", $Connect); Print "Status=News has been added"; When I execute this web file only the $Today string is updated correctly into DB. $UserName & $EnterNews which are text fields from the flash form are blank/null entries into MYSQL DB If I manually change data in field via MYSQL console each field is displayed correctly so my read script seems to work. Can anyone point me in correct direction to solve this one. Is it the way I have connected to MYSQL or should I be looking closer at the flash form.
View Replies !
View Related
How To Change Cell Values From NULL To BLANK?
In the result of a SELECT statement, how can you change cell values from NULL to BLANK? The following does NOT do it: SET fieldname = ' ' WHERE fieldname IS NULL Also, for colums with a DATE data type, I want to change 0000-00-00 to BLANK. For for colums with a numeric data type such as DOUBLE, I want to change 00.00 to BLANK. Again, the above doesn't work. How can I blank those fields?
View Replies !
View Related
Queries Pr.page
I use php/mysql for website, I am on novice level, - meaning I do not write php classes and such. I keep it real simple, with a simple db, full of records. question is; how many queries is normally run on a complexed site? take DevShed and imagine it was run on mysql, how many queries aprox does it need to get loaded? I am currenlty doing about 10 different queries pr. page to bring out some user details and different records of the user using 3-4 different db-tables.. and I wonder if this is normal, or if it's extremly bad programming / db design..? it loads fast enough, but it just seems alot.
View Replies !
View Related
Web Admin Page?
is there a web admin interface that is included when installing MySQL? If so, what is the url (e.g. http://localhost/mysqladmin)?? I am getting into programming in PHP and want to use MySQL on my development machine (they will both be on the same box to run concurrently). It's a Windows machine running IIS 5.0
View Replies !
View Related
Front Page
I am currently working on a site with SMF boards, i have downloaded TP (tinyportal) and i am trying to do a php code so all the threads from a certain board will go on the front page,help me with this code?
View Replies !
View Related
Navigating On Same Page
I want to pass the value of a variable via a pop-up menu (JS-behavior in MX) to change the title and the content dynamically in two layoutcells on the same page. In MySQL I have a database called E_Interface with one table and three colums: txtID_int (prim. key), title_int, content_int. The query in the recordset is: SELECT * FROM e_interface WHERE txtID_int = colname. As a variable I have set: (NAME)colname (DEFAULT VALUE) 1 (RUN-TIME VALUE) $HTTP_GET_VARS['txtID_int']. When I test the query I get the right row out of the database. I can't get a working php-statement in the pop-up menu.
View Replies !
View Related
Page Numeration
I am looking for a script snippet that will write out a number of pages with prev and next. I already have a numeration function, but I have more than 150 pages in my database, and for this the page numbers are all shown : ex: <prev 1 2 3 4 5 6 7 8 9 10 12 ....etc etc you get the picture....until 149 150 next > I would like a snippet that only writes out 10 page numbers at a time ex: <prev 1 2 3 4 5 6 7 8 9 10 next> ..and after clicking 10 or next> the ten next numbers should be shown: <prev 11 12 13 14 15 16 17 18 19 20 next> Anybody out there who has an idea as how to do that? Code:
View Replies !
View Related
Multiple Page
1. How to display my record in multiple page?2. How to display sort by word? i means page 1 for record(name) starting with A, page 2 starting with B, and so on
View Replies !
View Related
Page Counter
i challenged myself to make a Page Counter (simple i know) but i got an error i can not figure out, it probably something simple like a quote in wrong place, but i cant get it working.... here is my problem: using the code below, i manually enter a number into my MySQL table, and when the page loads, i want the counter to increment, however the PHP program changes the data to "$counu" i think this is because i have set the length of the field to max at 6, and when it increments a string, it changes the t in counter to a u.. dunno... Code:
View Replies !
View Related
Use MySQL As Part Of A Web Page
I would be interested in hearing opinions on how easy or difficult it it to use MySQL as part of a Web page. I have no experience with MySQL, but I have experience with MS Access and VB. The project that I'd like to put together is an online ordering facility for videotapes, not too many concurrent users and relatively low volume as these things go. I am also interested in how one would go about integrating the MySQL database with a site constructed with MS FrontPage (2000 or 2002).
View Replies !
View Related
Display Data Per Page
I have a search form which displays data depending on the user input. User can perform search based on certain ocupation and certain gender. After performing the appropiate 'select' statement, if, for example, you know there are 100 rows retrieved. How would you display these data over 10 different pages? eg: clicking on the search button will display the first 10 rows of data, then clicking on the 'Next Page' button will display the next 10 and so on
View Replies !
View Related
Link Keywords To A Page
so my company tasked me with writing an in house search engine. i have to index gigs and gigs of data (~100+) to do just simple keyword searches. the indexing is easy. my problem is i can't think of an efficient way to link the words to the page they appeared on and then store that relation in a database.
View Replies !
View Related
Login Page Creation
i am trying to create a login page on my site with user name and password i mainly work in dreamweiver on a mac platform. how can i use the mysql database to store the information and link dreamweiver to get the info i have no idea how mysql works so you have to be patient with me and guide me step by step.
View Replies !
View Related
Page Size Increased
I am trying to help search for a solution for the DB crashes for one of the application. So far all I know is that when you look in to the the error file it says " Page Size Increased". Being from a non DB backgroud I have checked the physical memory of the system and it does not seem to be an issue at this time. I am not sure what else could be the reasons for this message. If I can get some ideas I can start looking for the problems in the way the DB is setup.
View Replies !
View Related
|