Forum Moderators: coopster
Right now ini has errors off. I want to go in and change the logging to error logging on. PHP info shows that php ini is in the /etc path, but when I look at the etc path, I can't find the PHP ini file
The other thing is, I want to do is get the number of the last insert i did. I have a little library thing I am doing. right now the logic is
get author id from a select list,
get new book name from user input (html entities and mysql string cleaning first)
Insert new book
get last insert id
insert last insert id and author id into relationship table
When I try to print out the get last insert id from my php script it gives me resource id =3. That is not what I am looking for. I am looking for last insertion was 155 or somehting
How do I get last insert id() to give me the number, rather than the resourse.
Thanks
mysql_query(INSERT....blah blah);$lastid = mysql_insert_id();
print "$lastid";
Note: Because mysql_insert_id() acts on the last performed query, be sure to call mysql_insert_id() immediately after the query that generates the value.
You can turn on error reporting in your PHP scriipt
ini_set('display_errors', 1);
error_reporting(E_ALL¦E_STRICT);
Regards,
Brandon
The next step is to create a loop to install multiple authors into the relationship table. That should entertain me for a while.
As for the in stuff, I put it in my first config file. I can comment it out there pretty easily. Thanks for the help
I have a data base of books. many books have multiple authors. I want to list my books only once, but show both authors. If an author has multiple books, I want to show all the books for that author, and all authors, once for each book.
My query looks like this
"select books.title as title, concat(authors.efname,' ',authors.elname) as scribe, Topics.topic as subject from books inner join bookswritten using(book_id) inner join authors using(writer_id)inner join Topics using(Topic_id) where title like '%$profound%' order by authors.elname, books.title";
Is there any place I could put a distinct in the search that would make it so I get only one listing for all the authors?
Also, since php goes through the list of books one by one, would it be better to effectivly create a bunch of cards, one card per book?