I was trying to pull some values from Database using PHP. My DB is MySQL. Suddenly I found the error: mysql_num_rows() expects parameter 1 to be resource, boolean given in I was trying to find out the problem. I went through the forum post in Daniweb after googling Finally I fixed it. What was TROLLING is just a [ ‘ ‘ ] sign My query … Continue reading Error: mysql_num_rows() expects parameter 1 to be resource
I was writing PHP scripts the other day where I needed a calendar to pick dates. My user needs to pick date of any month or year. Problem was — Manual input of dates are tiresome and inefficient. On the other hand, if inputs are in string, I need to convert them to “datetime” as my datatype is such in the MySQL DB.
This code segment is for taking input and inserting into database
Adding data to database using input in Forms
We often need to insert data into database. We use forms to post the Data. This process is often lengthy and tiresome. You can easily insert data to Database Using Dreamweaver with almost no hand coding. If you are already familiar with DreamweaverCS5, just need to follow the steps below:
- Insert a form
- You can use tables to show the labels and Text fields and Lists for input
- If you want to use a list Dynamic (that will show data in list items fetching somewhere from database), you need to do 2 things:
I faced this problem while tried to post data in the database. It occurred because the Table had the Primary key as ID which was ”Default 0” and not even ”auto incremented”… for testing purpose in localhost, I just made it auto-increment and ”default” to ”none”. But this is not always a solution for a database may be. the following links might help if it … Continue reading solving error ”duplicate entry 0 for the key primary”
I had been trying to fetch some data from DB and do soem operations on them. The operation was to find the missing values that was expected to me. I have some values in DB that are multiples of 100 but not all the numbers — there are few missing. I need those missing numbers. The output will be the list of numbers that are missing between first and last number. Thanks to Pollob for his kind help to write this script.
I was trying to write a script on php that will be something like the moving bar of the ‘news websites’ where headlines are available. I did it, and here it goes for making it available for those people who needs it in future around the globe 😀 (sounds its poor work to shout, isn’t? LOL I know!) 😉
Let, I have a database named “news” and I want to show the news headlines in a box of the website like under the header. now, I have a table named “table_news”. I need to show the titles (headlines) of the news in descending order. moreover, I want that that when I will link on it, I will go to that specific news. So, a hyper link is needed to set on that HEADLINE thing.
In my case, the ID is a column and unique, auto-incremented. and the link of the respective news is like site.com/postid=ID. So I need to fetch the ID from the db and to set the HEADLINE’s ID on the text of the moving bar.
Continue reading “Fetching Column Items from DB and Creating Hyperlink in PHP”
Plugins I liked for a blog in wordpress. They are:
- Author information widget
- Authors widget
- Contact form 7
- Content and excerpt word limit
- Dustom smilies
- Dynamic header by nicasio design
Traverse a list: domains namelist = name* name = symbol predicates traverse(namelist) clauses traverse(). traverse([Head|Tail]):- write(Head),nl, traverse(Tail). Also try with: domains namelist=symbol* predicates member(symbol,namelist) club_member(symbol) clauses member(X,[X|_]). member(X,[_|Tail]):- member(X,Tail). club_member(Name):- member(Name,[a,b,c,d,e]). Continue reading Prolog program to traverse a list
Find out the MAXIMUM and MINIMUM values among three numbers: domains predicates max(integer,integer,integer) min(integer,integer,integer) maxmin(integer,integer,integer) clauses max(A,B,C):- A>B, A>C, write(A). max(A,B,C):- A>B, write(C). max(_,B,C):- B>C, write(B). max(_,_,C):- write(C). min(A,B,C):- A<B, A<C, write(A). min(A,B,C):- A<B, write(C). min(_,B,C):- B<C, write(B). min(_,_,C):- write(C). maxmin(A,B,C):- max(A,B,C), min(A,B,C). Continue reading Prolog program to find minimum and maximum