-
Posts
6,906 -
Joined
-
Last visited
-
Days Won
99
Everything posted by ginerjm
-
Perhaps if you found a decent mysql reference manual you'll see samples of both items you are asking about.
-
Take a look at a mysql manual and read up on the date_format function. It will convert any datetime,date or time type column to a readable string format, which is what you want. BTW - it is not recommended to use the * in query selections. Always specify the column names that you want in order to avoid future confusion about what you are querying for and to make future maintenance less problematic. Another personal foible is to define your query statement as a php variable and reference that instead of burying your query inside a statement. That way you can easily echo it out while debugging your script. Another thing to do is always check your query results to be sure you actually got something. You should do the same for anything that will do something external to php such as file opens, connection opens, etc.
-
Show database entries by todays date plus 7 days
ginerjm replied to EarthDay's topic in PHP Coding Help
Why does your code not look like what Barand gave you??? -
You didn't finish your answer to my question
-
It is code that makes sense without having to switch gears to interpret it.
-
Actually - Below are NOT php functions. It is simply some sloppy php code. <div class="col- big-news-here"> <?= $news2[0] ?> <?= $eventsHome[0] ?> </div> Here is some better code: echo " <div class='col- big-news-here'> $news2[0] $eventsHome[0] </div> "; Of course if you want to format it a bit you can add some more html.
-
I Assume that you php is lacking. I also suspect that your English is as well. How about using one or the other to fully document what you want help with?
-
There is no reason at all to change the name of a column in any table. Simply write your query correctly. Maybe if you do what Barand asked you to do 7 hours ago we can help you.
-
Well it makes no sense to me so it could be one of us. Good luck. I'll leave.
-
And how do you envision making the member look at their screen? Tell us please cause you are being very secretive.
-
I don't think the problem is that you have trouble with your php files. It is could be the design of your database.
-
You could have told me that my first assumption was incorrect. Now that I know this I have to ask: What is the connection between rows in the users table and the rows in the message table? You have to be able to link them together in order to do a query that joins the data
-
Since the 2 ids have to match in order to have a successful query I did not include the second id field in the query results of the updated query I gave you. I fail to see how your first link gives you anything since the first query cannot possibly execute until you change it. PS - your html is horribly outdated. The font tag has been long gone. Use css, either as defined ids or classes, or use it inline on your statements, with the former being the better way. PS - are you getting any error messages or do you not have it turned on?
-
None of that made any more sense than your first post. I don't know what you are referring to as "the first link". YOu started with a query statement that needed correcting and you are posting something about anchor tags.
-
<a href="#section2">Go to Section 2</a> and <h2 id="section2">Section 2</h2> When you click on the anchor tag it will send you to the place where there is something with an id matching the href value. You can create an anchor that directs you to another page also, just append the #xxx to your url as in: <a href="mywebpage.com#section2">Go to new page</a>
-
You want to copy a folder tree that has no files in it at all to another place? And once you have done that then what will you do with this new copy-of-a-similar-tree that also has no files in it? Trying to get a feel for your problem and why you are in this position.
-
I believe this is going to be rejected: $sql = "SELECT unique_id, fname, lname AND user_id FROM users, messages"; because the word AND is not a column name and there is no usage of it in selecting columns to be queried. Not sure why you are using it. I am assuming that users and messages are your 2 tables. How are the 2 tables connected? Is user_id the key to the messages table and you want to select each user and his/her associated messages? I would do something like this: $q = "SELECT u.unique_id, u.fname, u.lname FROM users u, messages m where u.unique_id = m.user_id order by u.lname,u.fname";
-
so it is simply a reminder to make you do something each day at a certain time? Why not set your phone to alert you?
-
So - you want an app that when you click on the icon for it, a screen pops up and shows you your next scheduled task? Tasks that are stored in a db table that your app checks and shows you?
-
On that first page visit all you have to do is see if there is ANY post values and avoid the validation code.. Simply if ($_SERVER['REQUEST_METHOD'] <> 'POST') { (displayypage) (exit) }
-
Since posted values, excluding radio and checkboxes, are always set, the test for isset doesn't really do anything. You have to validate the input value by checking the value.
-
Haven't used it in awhile but there is a use of the html <a> tag to do just what you want. Create anchors in the page where you want to come back to and then use the same name value in your call back to the page. Read up on it.
-
Do you know how to read the manual to understand how functions work? You are demonstrating not much of a capability to program with this example. Let me add some comments that might make you see what you are doing here. I am being rough but you already have an open topic on this forum and like some other people here you have begun a new adventure that is sending you off in a peculiar direction while your first topic is still hanging. $voucher_code = rand(1, 100000000000000000); // You are seeking a random number in a range that most systems can't even fathom due to integer size limits // per the PHP manual the max int is: 9223372036854775807 and you are exceeding that if ($stmt = $con->prepare('SELECT voucher_code FROM voucher_codes')) // you are querying for every row in your voucher_codes table { $stmt->bind_param('i', $voucher_code); // you are binding a value to what ???? $stmt->execute(); // you have just run your query $voucher_codes = mysqli_query($con, $stmt); // and now you are running your query again while (mysqli_num_rows($voucher_codes) > 0) { shuffle($voucher_code); // you are shuffling a single digit that was selected at random and has nothing to do with the query // Over and Over and Over and Over and Over...... } if (mysqli_num_rows($voucher_codes) == 0) { $voucher_code_unique = $voucher_code; // since your query resulted in no hits (how could that be?) you // are assigning your random number to a desired variable that // you don't assign a 'hit' to when there are any } } // all of the code above is only run if your prepare 'works' // What are you going to do if the prepare fails? AND in your response to my critique (criticism?) PLEASE don't re-post my post. We can all see it here.
-
Even tho a big crypto currency company just went belly-up? Hmmm