|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
You don't need a fax machine to get faxes. Get a fax-to-email fax number from CallWave. Try it free.
|
|
#1
|
|||
|
|||
|
News tutorial question
I am trying to make a publishing system that uses both MySQL for finite data and a txt file for longer bit fo info (descriptions etc.) I have found a good way of hacking the two examples in the tutorial section together BUT:
the news tutorial writes everything to a single text file news.txt thjat is delimited by | but how can you get it so that each entry is a seperate .txt file? For example if I have a bunch of data going to the MySQL server with an $id number could I name the text file &id.txt? How would i go about doing this? thanks for any help jon spooner PS this is BY FAR the best PHP tutorial site online thanks |
|
#2
|
|||
|
|||
|
RE: News tutorial question
After you fill out the database portion, use mysql_insert_id() to get the id for the row you just created (you have to use an autoincrement primary key), then create the file using the value returned from mysql_insert_id() in the filename.
or something along those lines |
|
#3
|
|||
|
|||
|
RE: News tutorial question
well I dont undertsand...
if I have a line that normally writes a file called text.txt fopen(echo 'text.txt','a'); how do I then get it to write fopen(echo mysql_insert_id() '.txt','a'); ???? thanks for the help? |
|
#4
|
||||
|
||||
|
RE: News tutorial question
Before
Now |
|
#5
|
|||
|
|||
|
RE: News tutorial question
Thanks for the help Hermawan.
Got that figured outnow I need help figuring out how to keep the system from "double" submitting. Basically the news tutorial leaves you with a system that adds headlines to the system but doesn't update the admin page to reflect the added headline. And if you hit reload it submits that information again. Also I will be submitting news with minor html formatting <BR> and <B> </b> tags. And when I do that and try to display that info with <PRE> or <CODE> tags it does not show the actaully html tags.. is there any creative way to do this? |
![]() |
| Viewing: Codewalkers Forums > Other > Tutorials > News tutorial question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|
|